/*
 * Copyright (c) 2000-2014 Apple Inc. All rights reserved.
 *
 * @APPLE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this
 * file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_LICENSE_HEADER_END@
 */

/*
 * genSCPreferences.c
 * - generates System Configuration header/cfile
 * - invoke with "header" to generate the header
 * - invoke with "cfile" to generate the cfile
 */

/*
 * Modification History
 *
 * 4 March 2004			Allan Nathanson (ajn@apple.com)
 * - an alternate scheme to help facilitate access to the schema
 *   definitions for cross-compilation to earlier releases AND
 *   access to CFM applications.
 *
 * 16 July 2003			Allan Nathanson (ajn@apple.com)
 * - changes to facilitate cross-compilation to earlier releases
 *
 * 5 May 2003			Allan Nathanson (ajn@apple.com)
 * - switch back to "extern const CFStringRef ..."
 *
 * 1 June 2001			Allan Nathanson <ajn@apple.com>
 * - public API conversion
 *
 * 27 Apr 2001			Allan Nathanson (ajn@apple.com)
 * - switch from "extern const CFStringRef ..." to "#define ..."
 *
 * 3 Nov 2000			Dieter Siegmund (dieter@apple)
 * - created
 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <mach/boolean.h>

char copyright_string[] =
"/*\n"
" * Copyright (c) 2000-2014 Apple Inc. All rights reserved.\n"
" *\n"
" * @APPLE_LICENSE_HEADER_START@\n"
" * \n"
" * This file contains Original Code and/or Modifications of Original Code\n"
" * as defined in and that are subject to the Apple Public Source License\n"
" * Version 2.0 (the 'License'). You may not use this file except in\n"
" * compliance with the License. Please obtain a copy of the License at\n"
" * http://www.opensource.apple.com/apsl/ and read it before using this\n"
" * file.\n"
" * \n"
" * The Original Code and all software distributed under the License are\n"
" * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\n"
" * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\n"
" * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\n"
" * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\n"
" * Please see the License for the specific language governing rights and\n"
" * limitations under the License.\n"
" * \n"
" * @APPLE_LICENSE_HEADER_END@\n"
" */\n";


typedef enum {
	DEFINE,
	DEFINE_PRIVATE,
	COMMENT,
	GROUP,
	SC_10_1,
	SC_10_2,
	SC_10_3,
	SC_10_1_10_4,	// deprecated in 10.4
	SC_10_4,
	SC_10_1_10_5,	// deprecated in 10.5
	SC_10_5,
	SC_10_5_10_7,	// deprecated in 10.7
	SC_10_1_10_6,	// deprecated in 10.6
	SC_10_2_10_6,	// deprecated in 10.6
	SC_10_1_10_9,	// deprecated in 10.9
	SC_10_2_10_9,	// deprecated in 10.9
	SC_10_3_10_9,	// deprecated in 10.9
	SC_10_4_10_9,	// deprecated in 10.9
	SC_10_6_IPHONE_2_0,
	SC_10_6_IPHONE_3_0,
	SC_10_7_IPHONE_4_0,
	COMMENT_PRIVATE,
	GROUP_PRIVATE,
	SC_10_5_PRIVATE,
	SC_10_6_IPHONE_2_0_PRIVATE,
	SC_10_6_IPHONE_3_0_PRIVATE,
	SC_10_7_IPHONE_4_0_PRIVATE,
	SC_10_7_IPHONE_5_0_PRIVATE,
	SC_10_8_IPHONE_6_0_PRIVATE,
	SC_10_9_IPHONE_6_0_PRIVATE,
	SC_10_9_IPHONE_7_0_PRIVATE,
	SC_10_10_IPHONE_7_0_PRIVATE,
	SC_10_10_IPHONE_8_0_PRIVATE,
	SC_IPHONE_2_0_PRIVATE,
	COMMENT_DEPRECATED,
	GROUP_DEPRECATED,
	END
} controlType;

#define SC_SCHEMA_DECLARATION	"SC_SCHEMA_DECLARATION"
#define SC_SCHEMA_KV		"SC_SCHEMA_KV"

#define KEY_PREFIX		"kSC"

#define COMP			"Comp"
#define DYNAMICSTORE		"DynamicStore"
#define PREF			"Pref"
#define PROP			"Prop"
#define PATH			"Path"
#define NETENT			"EntNet"
#define NETPROP			"PropNet"
#define NETVAL			"ValNet"
#define SETUPENT		"EntSetup"
#define SETUPPROP		"PropSetup"
#define SYSTEMENT		"EntSystem"
#define SYSTEMPROP		"PropSystem"
#define RESV			"Resv"
#define USERSENT		"EntUsers"
#define USERSPROP		"PropUsers"
#define VERSION			"Version"
#define VIRTUALPROP		"PropVirtualNetworkInterfaces"

#define CFARRAY_CFDICTIONARY	"CFArray[CFDictionary]"
#define CFARRAY_CFNUMBER	"CFArray[CFNumber]"
#define CFARRAY_CFSTRING	"CFArray[CFString]"
#define CFBOOLEAN		"CFBoolean"
#define CFDATA			"CFData"
#define CFDATE			"CFDate"
#define CFDICTIONARY		"CFDictionary"
#define CFNUMBER		"CFNumber"
#define CFNUMBER_BOOL		"CFNumber (0 or 1)"
#define CFSTRING		"CFString"

#define APP			"App"
#define ARP			"ARP"
#define ACCESSPOINTNAME		"AccessPointName"
#define ACCOUNT			"Account"
#define ACSP			"ACSP"			// Apple Client Server Protocol
#define ACTION			"Action"
#define ACTIVE			"Active"
#define ADDITIONAL		"Additional"
#define ADDRESS			"Address"
#define ADDRESSES		"Addresses"
#define AFTER			"After"
#define AGGRESSIVE		"Aggressive"
#define AIRPORT			"AirPort"
#define ALERT			"Alert"
#define ALIVE			"Alive"
#define ALLOW			"Allow"
#define ALLOWED			"Allowed"
#define ALLOWNETCREATION	"AllowNetCreation"
#define ALTERNATE		"Alternate"
#define ALWAYS			"Always"
#define ANYREGEX		"AnyRegex"
#define APPLETALK		"AppleTalk"
#define AUTH			"Auth"
#define AUTHENTICATIONMETHOD	"AuthenticationMethod"
#define AUTOCONFIG		"AutoConfig"
#define AUTODISCOVERY		"AutoDiscovery"
#define AUTOMATIC		"Automatic"
#define AV			"AV"
#define BEFORE			"Before"
#define BINDINGMETHODS		"BindingMethods"
#define	BOND			"Bond"
#define BOOTP			"BOOTP"
#define	BRIDGE			"Bridge"
#define BROADCAST		"Broadcast"
#define BYPASS			"Bypass"
#define CALLWAITINGAUDIBLEALERT	"CallWaitingAudibleAlert"
#define CAPABILITY		"Capability"
#define CAPABILITIES		"Capabilities"
#define CAUSE			"Cause"
#define CCP			"CCP"
#define CHAP			"CHAP"
#define CELLULAR		"Cellular"
#define CERTIFICATE		"Certificate"
#define COMM			"Comm"
#define COMPATIBLE		"Compatible"
#define COMPRESSIONACFIELD	"CompressionACField"
#define COMPRESSIONPFIELD	"CompressionPField"
#define COMPRESSIONVJ		"CompressionVJ"
#define COMPUTERNAME		"ComputerName"
#define CONFIGMETHOD		"ConfigMethod"
#define CONFIRMED		"Confirmed"
#define CONNECT			"Connect"
#define CONNECTDELAY		"ConnectDelay"
#define CONNECTION		"Connection"
#define CONNECTSPEED		"ConnectSpeed"
#define CONNECTTIME		"ConnectTime"
#define CONSERVATIVE		"Conservative"
#define CONSOLEUSER		"ConsoleUser"
#define CONTEXTID		"ContextID"
#define CREDENTIAL		"Credential"
#define CURRENTSET		"CurrentSet"
#define DATACOMPRESSION		"DataCompression"
#define DEFAULT			"Default"
#define DEFAULTZONE		"DefaultZone"
#define DESIGNATED		"Designated"
#define DEST			"Dest"
#define DESTINATION		"Destination"
#define DETACHING		"Detaching"
#define DEVICE			"Device"
#define DEVICENAME		"DeviceName"
#define DHCP			"DHCP"
#define DHCPCLIENTID		"DHCPClientID"
#define DIALMODE		"DialMode"
#define DIALONDEMAND		"DialOnDemand"
#define DISCONNECT		"Disconnect"
#define DISCONNECTONANSWER	"DisconnectOnAnswer"
#define DISCONNECTONFASTUSERSWITCH	"DisconnectOnFastUserSwitch"
#define DISCONNECTONIDLE	"DisconnectOnIdle"
#define DISCONNECTONIDLETIMER	"DisconnectOnIdleTimer"
#define DISCONNECTONLOGOUT	"DisconnectOnLogout"
#define DISCONNECTONSLEEP	"DisconnectOnSleep"
#define DISCONNECTONWAKE	"DisconnectOnWake"
#define DISCONNECTONWAKETIMER	"DisconnectOnWakeTimer"
#define DISCONNECTTIME		"DisconnectTime"
#define DISPLAYTERMINALWINDOW	"DisplayTerminalWindow"
#define DNS			"DNS"
#define DOMAIN 			"Domain"
#define DOMAINS			"Domains"
#define DURINGSLEEP "DuringSleep"
#define EAP			"EAP"
#define EAPOL			"EAPOL"
#define ECHO			"Echo"
#define ECHOFAILURE		"EchoFailure"
#define ECHOINTERVAL		"EchoInterval"
#define ENABLE			"Enable"
#define ENABLED			"Enabled"
#define ENCODING		"Encoding"
#define ENCRYPTION		"Encryption"
#define ERRORCORRECTION		"ErrorCorrection"
#define ETHERNET		"Ethernet"
#define EVALUATE		"Evaluate"
#define EXCEPTIONSLIST		"ExceptionsList"
#define EXCLUDED		"Excluded"
#define EXCLUDESIMPLEHOSTNAMES	"ExcludeSimpleHostnames"
#define EXECUTABLE		"Executable"
#define EXPENSIVE		"Expensive"
#define EXTERNAL		"External"
#define FAILOVER		"Failover"
#define FAILURE			"Failure"
#define	FALLBACK		"FallBack"
#define FILE			"File"
#define FIREWIRE		"FireWire"
#define FIRST			"First"
#define FLAGS			"Flags"
#define FTP			"FTP"
#define GATEWAY			"Gateway"
#define GID			"GID"
#define GLOBAL			"Global"
#define GOPHER			"Gopher"
#define HARDWARE		"Hardware"
#define HIGH			"High"
#define HOLD			"Hold"
#define HOSTNAME		"HostName"
#define HOSTNAMES		"HostNames"
#define HTTP			"HTTP"
#define HTTPS			"HTTPS"
#define HYBRID			"Hybrid"
#define IDENTIFIER		"Identifier"
#define IDLEREMINDER		"IdleReminder"
#define IDLEREMINDERTIMER	"IdleReminderTimer"
#define IFNEEDED		"IfNeeded"
#define IGNORE			"Ignore"
#define IGNOREDIALTONE		"IgnoreDialTone"
#define IGNORELINKSTATUS	"IgnoreLinkStatus"
#define INACTIVE		"Inactive"
#define INCLUDED		"Included"
#define	INFO			"Info"
#define INFORM			"INFORM"
#define INTERFACE		"Interface"
#define INTERFACENAME		"InterfaceName"
#define INTERFACES		"Interfaces"
#define IP			"IP"
#define IPCP			"IPCP"
#define IPV4			"IPv4"
#define IPV6			"IPv6"
#define IPSEC			"IPSec"
#define JAVASCRIPT		"JavaScript"
#define JOIN			"Join"
#define JUMBO_MTU		"JUMBO_MTU"
#define KEYCHAIN		"Keychain"
#define KEYID			"KeyID"
#define L2TP			"L2TP"
#define LAST			"Last"
#define LAYER			"Layer"
#define LCP			"LCP"
#define LINK			"Link"
#define LINKISSUES		"LinkIssues"
#define LINKLOCAL		"LinkLocal"
#define LINKQUALITY		"LinkQuality"
#define LOCALCERTIFICATE	"LocalCertificate"
#define LOCALHOSTNAME		"LocalHostName"
#define LOCALIDENTIFIER		"LocalIdentifier"
#define LOGFILE			"Logfile"
#define LOOPBACK		"Loopback"
#define LOW			"Low"
#define LRO			"LRO"
#define MACADDRESS		"MACAddress"
#define MANUAL			"Manual"
#define MATCH			"Match"
#define MEDIA			"Media"
#define MIXED			"Mixed"
#define MODEL			"Model"
#define MODE			"Mode"
#define MODEM			"Modem"
#define MODULEID		"ModuleID"
#define MPPE40			"MPPE40"
#define MPPE128			"MPPE128"
#define MRU			"MRU"
#define MSCHAP1			"MSCHAP1"
#define MSCHAP2			"MSCHAP2"
#define MTU			"MTU"
#define NAME			"Name"
#define NETBIOS			"NetBIOS"
#define NETINFO			"NetInfo"
#define NETWORK			"Network"
#define NETWORKID		"NetworkID"
#define NETWORKRANGE		"NetworkRange"
#define NETWORKSERVICES		"NetworkServices"
#define NEVER			"Never"
#define NO			"No"
#define NODE			"Node"
#define NODEID			"NodeID"
#define NOTE			"Note"
#define ONDEMAND		"OnDemand"
#define ONRETRY			"OnRetry"
#define OPTIONS			"Options"
#define ORDER			"Order"
#define ORDERS			"Orders"
#define OVERRIDEPRIMARY		"OverridePrimary"
#define PAP			"PAP"
#define PARAMETERS		"Parameters"
#define PASSIVE			"Passive"
#define PASSWORD		"Password"
#define PEER			"Peer"
#define PERSONALITY		"Personality"
#define PLUGIN			"Plugin"
#define PLUGINS			"Plugins"
#define POWER			"Power"
#define PORT			"Port"
#define PPP			"PPP"
#define PPPOE			"PPPoE"
#define PPPSERIAL		"PPPSerial"
#define PPTP			"PPTP"
#define PREFERRED		"Preferred"
#define PREFIXLENGTH		"PrefixLength"
#define PREFS			"Prefs"
#define PRIMARYINTERFACE	"PrimaryInterface"
#define PRIMARYRANK		"PrimaryRank"
#define PRIMARYSERVICE		"PrimaryService"
#define PRIORITY		"Priority"
#define PROBE			"Probe"
#define PROMPT			"Prompt"
#define PROTOCOL		"Protocol"
#define PROXIES			"Proxies"
#define PROXY			"Proxy"
#define PULSEDIAL		"PulseDial"
#define RANKED			"Ranked"
#define RECEIVEACCM		"ReceiveACCM"
#define RECENT			"Recent"
#define REDIALCOUNT		"RedialCount"
#define REDIAL			"Redial"
#define REDIALINTERVAL		"RedialInterval"
#define REGION			"Region"
#define RELAY			"Relay"
#define REMINDER		"Reminder"
#define REMINDERTIME		"ReminderTime"
#define REMOTEADDRESS		"RemoteAddress"
#define REQUESTED		"Requested"
#define REQUIRED		"Required"
#define REQUIREMENT		"Requirement"
#define RESOLVED		"Resolved"
#define RETRYCONNECTTIME	"RetryConnectTime"
#define ROOTSEPARATOR		"RootSeparator"
#define ROUTE			"Route"
#define ROUTER			"Router"
#define ROUTES			"Routes"
#define ROUTERADVERTISEMENT	"RouterAdvertisement"
#define RTSP			"RTSP"
#define RULE			"Rule"
#define RULES			"Rules"
#define RXCSUM			"RXCSUM"
#define SAVEPASSWORDS		"SavePasswords"
#define SCOPE			"Scope"
#define SCOPED			"Scoped"
#define SCRIPT			"Script"
#define SEARCH			"Search"
#define SEEDNETWORKRANGE	"SeedNetworkRange"
#define SEEDROUTER		"SeedRouter"
#define SEEDZONES		"SeedZones"
#define SERVER			"Server"
#define SERVERS			"Servers"
#define SERVICE			"Service"
#define SERVICES		"Services"
#define SERVICEIDS		"ServiceIDs"
#define SESSIONTIMER		"SessionTimer"
#define SETS			"Sets"
#define SETUP			"Setup"
#define	SHAREDSECRET		"SharedSecret"
#define SIGNING			"Signing"
#define SMB			"SMB"
#define SOCKS			"SOCKS"
#define SORTLIST		"SortList"
#define SPEAKER			"Speaker"
#define SPEED			"Speed"
#define SSID			"SSID"
#define STATE			"State"
#define STATUS			"Status"
#define STF			"6to4"
#define STRONGEST		"Strongest"
#define SUBNETMASK		"SubnetMask"
#define SUBNETMASKS		"SubnetMasks"
#define SUBTYPE			"SubType"
#define SUPPLEMENTAL		"Supplemental"
#define SUPPORTED		"Supported"
#define SUPPORTSMODEMONHOLD	"SupportsModemOnHold"
#define SUSPENDED		"Suspended"
#define SYSTEM			"System"
#define TAG			"Tag"
#define TAGS			"Tags"
#define TERMINALSCRIPT		"TerminalScript"
#define TIMEOUT			"Timeout"
#define TIMESTAMP		"TimeStamp"
#define TOKEN			"Token"
#define TRANSMITACCM		"TransmitACCM"
#define TRANSPORT		"Transport"
#define TSO			"TSO"
#define TSO4			"TSO4"
#define TSO6			"TSO6"
#define TXCSUM			"TXCSUM"
#define TYPE			"Type"
#define UID			"UID"
#define UPDATED			"Updated"
#define URLSTRING		"URLString"
#define USERDEFINEDNAME		"UserDefinedName"
#define USE			"Use"
#define USERS			"Users"
#define UUID			"UUID"
#define VENDOR			"Vendor"
#define VERBOSELOGGING		"VerboseLogging"
#define VIRTUALNETWORKINTERFACES	"VirtualNetworkInterfaces"
#define	VLAN			"VLAN"
#define VLAN_HWTAGGING		"VLAN_HWTAGGING"
#define VLAN_MTU		"VLAN_MTU"
#define	VPN			"VPN"
#define WAITFORDIALTONE		"WaitForDialTone"
#define WIFI			"WiFi"
#define WINS			"WINS"
#define WORKGROUP		"Workgroup"
#define XAUTH			"XAuth"


typedef struct {
    int				control;
    const char *		prefix;
    const char *		key;
    const char *		value;
    const char *		type;
} schemaDefinition;

static schemaDefinition names[] = {

  { GROUP, NULL, "Reserved Keys", NULL, NULL },

    { SC_10_1, RESV, LINK,	"__LINK__", CFSTRING },
    { SC_10_1, RESV, INACTIVE,	"__INACTIVE__", NULL },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP, NULL, "Generic Keys", NULL, NULL },

    { SC_10_1, PROP, INTERFACENAME, NULL, CFSTRING },
    { SC_10_1, PROP, MACADDRESS, NULL, CFSTRING },
    { SC_10_1, PROP, USERDEFINEDNAME, NULL, CFSTRING },
    { SC_10_1, PROP, VERSION, NULL, CFSTRING },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP_PRIVATE, NULL, "Generic Keys", NULL, NULL },
    { SC_10_10_IPHONE_8_0_PRIVATE, PROP, CONFIRMED INTERFACENAME, NULL, CFSTRING },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },


  { GROUP, PREF, "Preference Keys", NULL, NULL },

    { SC_10_1, PREF, CURRENTSET, NULL, CFSTRING },
    { SC_10_1, PREF, NETWORKSERVICES, NULL, CFDICTIONARY },
    { SC_10_1, PREF, SETS, NULL, CFDICTIONARY },
    { SC_10_1, PREF, SYSTEM, NULL, CFDICTIONARY },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP_PRIVATE, PREF, "Preference Keys", NULL, NULL },

    { SC_10_5_PRIVATE, PREF, VIRTUALNETWORKINTERFACES, NULL, CFDICTIONARY },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },

  { GROUP, COMP, "Component Keys", NULL, NULL },

    { SC_10_1, COMP, NETWORK, NULL, NULL },
    { SC_10_1, COMP, SERVICE, NULL, NULL },
    { SC_10_1, COMP, GLOBAL, NULL, NULL },
    { SC_10_2, COMP, HOSTNAMES, NULL, NULL },
    { SC_10_1, COMP, INTERFACE, NULL, NULL },
    { SC_10_1, COMP, SYSTEM, NULL, NULL },
    { SC_10_1, COMP, USERS, NULL, NULL },
    { COMMENT, "", NULL, NULL, NULL },

    { COMMENT, "--- Regex pattern which matches any component ---", NULL },
    { SC_10_1, COMP, ANYREGEX, "[^/]+", NULL },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP, NETENT, "Network Entity Keys", NULL, NULL },

    { SC_10_1, NETENT, AIRPORT, NULL, CFDICTIONARY },
    { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
    { SC_10_1_10_6, NETENT, APPLETALK, NULL, CFDICTIONARY },
    { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
    { SC_10_1, NETENT, DHCP, NULL, CFDICTIONARY },
    { SC_10_1, NETENT, DNS, NULL, CFDICTIONARY },
    { SC_10_1, NETENT, ETHERNET, NULL, CFDICTIONARY },
    { SC_10_3, NETENT, FIREWIRE, NULL, CFDICTIONARY },
    { SC_10_1, NETENT, INTERFACE, NULL, CFDICTIONARY },
    { SC_10_5, NETENT, IPSEC, NULL, CFDICTIONARY },
    { SC_10_1, NETENT, IPV4, NULL, CFDICTIONARY },
    { SC_10_1, NETENT, IPV6, NULL, CFDICTIONARY },
    { SC_10_3, NETENT, L2TP, NULL, CFDICTIONARY },
    { SC_10_1, NETENT, LINK, NULL, CFDICTIONARY },
    { SC_10_1, NETENT, MODEM, NULL, CFDICTIONARY },
    { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
    { SC_10_1_10_5, NETENT, NETINFO, NULL, CFDICTIONARY },
    { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
    { SC_10_1, NETENT, PPP, NULL, CFDICTIONARY },
    { SC_10_1, NETENT, PPPOE, NULL, CFDICTIONARY },
    { SC_10_3, NETENT, PPPSERIAL, NULL, CFDICTIONARY },
    { SC_10_3, NETENT, PPTP, NULL, CFDICTIONARY },
    { SC_10_1, NETENT, PROXIES, NULL, CFDICTIONARY },
    { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
    { SC_10_5, NETENT, SMB, NULL, CFDICTIONARY },
    { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
    { SC_10_3, NETENT, STF, NULL, CFDICTIONARY },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP_PRIVATE, NETENT, "Network Entity Keys", NULL, NULL },

    { SC_10_10_IPHONE_7_0_PRIVATE, NETENT, ACTIVE DURINGSLEEP REQUESTED, NULL, CFDICTIONARY},
    { SC_10_10_IPHONE_7_0_PRIVATE, NETENT, ACTIVE DURINGSLEEP SUPPORTED, NULL, CFDICTIONARY},
    { SC_10_9_IPHONE_7_0_PRIVATE, NETENT, APP LAYER, NULL, CFDICTIONARY},
    { SC_10_5_PRIVATE, NETENT, EAPOL, NULL, CFDICTIONARY },
    { SC_10_10_IPHONE_8_0_PRIVATE, NETENT, IPV4 ROUTER ARP FAILURE, NULL, NULL},
    { SC_10_10_IPHONE_8_0_PRIVATE, NETENT, IPV4 ROUTER ARP ALIVE, NULL, NULL},
    { SC_10_9_IPHONE_7_0_PRIVATE, NETENT, LINKISSUES, NULL, CFDICTIONARY},
    { SC_10_7_IPHONE_5_0_PRIVATE, NETENT, LINKQUALITY, NULL, CFDICTIONARY}, 
    { SC_10_7_IPHONE_4_0_PRIVATE, NETENT, LOOPBACK, NULL, CFDICTIONARY },
    { SC_10_6_IPHONE_3_0_PRIVATE, NETENT, ONDEMAND, NULL, CFDICTIONARY },
    { SC_10_6_IPHONE_2_0_PRIVATE, NETENT, SERVICE, "__SERVICE__", CFDICTIONARY },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETENT, VPN, NULL, CFDICTIONARY },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },

  { GROUP, NETPROP, KEY_PREFIX COMP NETWORK " Properties", NULL, NULL },

    { SC_10_2, NETPROP, OVERRIDEPRIMARY, NULL, CFNUMBER_BOOL },
    { SC_10_1, NETPROP, SERVICE ORDER, NULL, CFARRAY_CFSTRING },
    { SC_10_1, NETPROP, PPP OVERRIDEPRIMARY, NULL, CFNUMBER_BOOL },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP_PRIVATE, NETPROP, KEY_PREFIX COMP NETWORK " Properties", NULL, NULL },

    { SC_10_5_PRIVATE, NETPROP, IGNORELINKSTATUS, NULL, CFBOOLEAN },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },	

  { GROUP, NETPROP INTERFACES, KEY_PREFIX COMP NETWORK INTERFACE " Properties", NULL, NULL },

    { SC_10_2, NETPROP, INTERFACES, NULL, CFARRAY_CFSTRING },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP, NETPROP LOCALHOSTNAME, KEY_PREFIX COMP NETWORK HOSTNAMES " Properties", NULL, NULL },

    { SC_10_2, NETPROP, LOCALHOSTNAME, NULL, CFSTRING },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP_DEPRECATED, NETPROP AIRPORT, KEY_PREFIX NETENT AIRPORT " (Hardware) Entity Keys", NULL, NULL },

    { SC_10_2_10_9, NETPROP AIRPORT, ALLOWNETCREATION, NULL, CFNUMBER_BOOL },
    { SC_10_1_10_9, NETPROP AIRPORT, AUTH PASSWORD, NULL, CFDATA },
    { SC_10_1_10_9, NETPROP AIRPORT, AUTH PASSWORD ENCRYPTION, NULL, CFSTRING },
    { SC_10_2_10_9, NETPROP AIRPORT, JOIN MODE, NULL, CFSTRING },
    { SC_10_1_10_9, NETPROP AIRPORT, POWER ENABLED, NULL, CFNUMBER_BOOL },
    { SC_10_1_10_9, NETPROP AIRPORT, PREFERRED NETWORK, NULL, CFSTRING },
    { SC_10_2_10_9, NETPROP AIRPORT, SAVEPASSWORDS, NULL, CFNUMBER_BOOL },
    { COMMENT_DEPRECATED, "", NULL, NULL, NULL },
    { COMMENT_DEPRECATED, "--- " KEY_PREFIX NETPROP AIRPORT JOIN MODE " values ---", NULL, NULL, NULL },
    { SC_10_3_10_9, NETVAL AIRPORT JOIN MODE, AUTOMATIC, NULL, NULL },
    { SC_10_2_10_9, NETVAL AIRPORT JOIN MODE, PREFERRED, NULL, NULL },
    { SC_10_4_10_9, NETVAL AIRPORT JOIN MODE, RANKED, NULL, NULL },
    { SC_10_2_10_9, NETVAL AIRPORT JOIN MODE, RECENT, NULL, NULL },
    { SC_10_2_10_9, NETVAL AIRPORT JOIN MODE, STRONGEST, NULL, NULL },
    { COMMENT_DEPRECATED, "", NULL, NULL, NULL },
    { COMMENT_DEPRECATED, "--- " KEY_PREFIX NETPROP AIRPORT PASSWORD ENCRYPTION " values ---", NULL, NULL, NULL },
    { SC_10_3_10_9, NETVAL AIRPORT AUTH PASSWORD ENCRYPTION, KEYCHAIN, NULL, NULL },
    { COMMENT_DEPRECATED, "", NULL, NULL, NULL },

  { GROUP_DEPRECATED, NETPROP APPLETALK, KEY_PREFIX NETENT APPLETALK " Entity Keys", NULL, NULL },

    { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
    { SC_10_1_10_6, NETPROP APPLETALK, COMPUTERNAME, NULL, CFSTRING },
    { SC_10_1_10_6, NETPROP APPLETALK, COMPUTERNAME ENCODING, NULL, CFNUMBER },
    { SC_10_1_10_6, NETPROP APPLETALK, CONFIGMETHOD, NULL, CFSTRING },
    { SC_10_1_10_6, NETPROP APPLETALK, DEFAULTZONE, NULL, CFSTRING },
    { SC_10_1_10_6, NETPROP APPLETALK, NETWORKID, NULL, CFNUMBER },
    { SC_10_2_10_6, NETPROP APPLETALK, NETWORKRANGE, NULL, CFARRAY_CFNUMBER },
    { SC_10_1_10_6, NETPROP APPLETALK, NODEID, NULL, CFNUMBER },
    { SC_10_1_10_6, NETPROP APPLETALK, SEEDNETWORKRANGE, NULL, CFARRAY_CFNUMBER },
    { SC_10_1_10_6, NETPROP APPLETALK, SEEDZONES, NULL, CFARRAY_CFSTRING },
    { COMMENT_DEPRECATED, "", NULL, NULL, NULL },
    { COMMENT_DEPRECATED, "--- " KEY_PREFIX NETPROP APPLETALK CONFIGMETHOD " values ---", NULL, NULL, NULL },
    { SC_10_1_10_6, NETVAL APPLETALK CONFIGMETHOD, NODE, NULL, NULL },
    { SC_10_1_10_6, NETVAL APPLETALK CONFIGMETHOD, ROUTER, NULL, NULL },
    { SC_10_1_10_6, NETVAL APPLETALK CONFIGMETHOD, SEEDROUTER, NULL, NULL },
    { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
    { COMMENT_DEPRECATED, "", NULL, NULL, NULL },


  { GROUP, NETPROP DNS, KEY_PREFIX NETENT DNS " Entity Keys", NULL, NULL },

    { SC_10_1, NETPROP DNS, DOMAIN NAME, NULL, CFSTRING },
    { SC_10_4, NETPROP DNS, OPTIONS, NULL, CFSTRING },
    { SC_10_1, NETPROP DNS, SEARCH DOMAINS, NULL, CFARRAY_CFSTRING},
    { SC_10_4, NETPROP DNS, SEARCH ORDER, NULL, CFNUMBER},
    { SC_10_1, NETPROP DNS, SERVER ADDRESSES, NULL, CFARRAY_CFSTRING },
    { SC_10_4, NETPROP DNS, SERVER PORT, NULL, CFNUMBER },
    { SC_10_4, NETPROP DNS, SERVER TIMEOUT, NULL, CFNUMBER },
    { SC_10_1, NETPROP DNS, SORTLIST, NULL, CFARRAY_CFSTRING },
    { SC_10_4, NETPROP DNS, SUPPLEMENTAL MATCH DOMAINS, NULL, CFARRAY_CFSTRING},
    { SC_10_4, NETPROP DNS, SUPPLEMENTAL MATCH ORDERS, NULL, CFARRAY_CFNUMBER},
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP_PRIVATE, NETPROP DNS, KEY_PREFIX NETENT DNS " Entity Keys", NULL, NULL },

	{ SC_10_9_IPHONE_7_0_PRIVATE, NETPROP DNS, SERVICE IDENTIFIER, NULL, CFNUMBER },
	{ SC_10_9_IPHONE_7_0_PRIVATE, NETPROP DNS, SUPPLEMENTAL MATCH DOMAINS NO SEARCH, NULL, CFNUMBER_BOOL},
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },

  { GROUP, NETPROP ETHERNET, KEY_PREFIX NETENT ETHERNET " (Hardware) Entity Keys", NULL, NULL },

    { SC_10_2, NETPROP ETHERNET, MEDIA SUBTYPE, NULL, CFSTRING },
    { SC_10_2, NETPROP ETHERNET, MEDIA OPTIONS, NULL, CFARRAY_CFSTRING },
    { SC_10_2, NETPROP ETHERNET, MTU, NULL, CFNUMBER },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP_PRIVATE, NETPROP ETHERNET, KEY_PREFIX NETENT ETHERNET " (Hardware) Entity Keys", NULL, NULL },

    { SC_10_7_IPHONE_5_0_PRIVATE, NETPROP ETHERNET, CAPABILITY AV, AV, CFNUMBER_BOOL },
    { SC_10_7_IPHONE_5_0_PRIVATE, NETPROP ETHERNET, CAPABILITY JUMBO_MTU, JUMBO_MTU, CFNUMBER_BOOL },
    { SC_10_7_IPHONE_5_0_PRIVATE, NETPROP ETHERNET, CAPABILITY LRO, LRO, CFNUMBER_BOOL },
    { SC_10_7_IPHONE_5_0_PRIVATE, NETPROP ETHERNET, CAPABILITY RXCSUM, RXCSUM, CFNUMBER_BOOL },
    { SC_10_7_IPHONE_5_0_PRIVATE, NETPROP ETHERNET, CAPABILITY TSO, TSO, CFNUMBER_BOOL },
    { SC_10_7_IPHONE_5_0_PRIVATE, NETPROP ETHERNET, CAPABILITY TSO4, TSO4, CFNUMBER_BOOL },
    { SC_10_7_IPHONE_5_0_PRIVATE, NETPROP ETHERNET, CAPABILITY TSO6, TSO6, CFNUMBER_BOOL },
    { SC_10_7_IPHONE_5_0_PRIVATE, NETPROP ETHERNET, CAPABILITY TXCSUM, TXCSUM, CFNUMBER_BOOL },
    { SC_10_7_IPHONE_5_0_PRIVATE, NETPROP ETHERNET, CAPABILITY VLAN_HWTAGGING, VLAN_HWTAGGING, CFNUMBER_BOOL },
    { SC_10_7_IPHONE_5_0_PRIVATE, NETPROP ETHERNET, CAPABILITY VLAN_MTU, VLAN_MTU, CFNUMBER_BOOL },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },

  { GROUP, NETPROP FIREWIRE, KEY_PREFIX NETENT FIREWIRE " (Hardware) Entity Keys", NULL, NULL },

    { COMMENT, "* RESERVED FOR FUTURE USE *", NULL, NULL, NULL },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP, NETPROP INTERFACE, KEY_PREFIX NETENT INTERFACE " Entity Keys", NULL, NULL },

    { SC_10_1, NETPROP INTERFACE, DEVICENAME, NULL, CFSTRING },
    { SC_10_1, NETPROP INTERFACE, HARDWARE, NULL, CFSTRING },
    { SC_10_1, NETPROP INTERFACE, TYPE, NULL, CFSTRING },
    { SC_10_1, NETPROP INTERFACE, SUBTYPE, NULL, CFSTRING },
    { SC_10_2, NETPROP INTERFACE, SUPPORTSMODEMONHOLD, NULL, CFNUMBER_BOOL },
    { COMMENT, "", NULL, NULL, NULL },
    { COMMENT, "--- " KEY_PREFIX NETPROP INTERFACE TYPE " values ---", NULL, NULL, NULL },
    { SC_10_1, NETVAL INTERFACE TYPE, ETHERNET, NULL, NULL },
    { SC_10_3, NETVAL INTERFACE TYPE, FIREWIRE, NULL, NULL },
    { SC_10_1, NETVAL INTERFACE TYPE, PPP, NULL, NULL },
    { SC_10_3, NETVAL INTERFACE TYPE, STF, NULL, NULL },
    { SC_10_6_IPHONE_2_0, NETVAL INTERFACE TYPE, IPSEC, NULL, NULL },
    { COMMENT, "", NULL, NULL, NULL },
    { COMMENT, "--- " KEY_PREFIX NETPROP SERVICE SUBTYPE " values (for " PPP ") ---", NULL, NULL, NULL },
    { SC_10_1, NETVAL INTERFACE SUBTYPE, PPPOE, NULL, NULL },
    { SC_10_1, NETVAL INTERFACE SUBTYPE, PPPSERIAL, NULL, NULL },
    { SC_10_2, NETVAL INTERFACE SUBTYPE, PPTP, NULL, NULL },
    { SC_10_3, NETVAL INTERFACE SUBTYPE, L2TP, NULL, NULL },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP_PRIVATE, NETPROP INTERFACE, KEY_PREFIX NETENT INTERFACE " Entity Keys", NULL, NULL },

    { COMMENT_PRIVATE, "--- " KEY_PREFIX NETPROP INTERFACE TYPE " values ---", NULL, NULL, NULL },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETVAL INTERFACE TYPE, LOOPBACK, NULL, NULL },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETVAL INTERFACE TYPE, VPN, NULL, NULL },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },

  { GROUP, NETPROP IPSEC, KEY_PREFIX NETENT IPSEC " Entity Keys", NULL, NULL },

    { SC_10_5, NETPROP IPSEC, AUTHENTICATIONMETHOD, NULL, CFSTRING },
    { SC_10_5, NETPROP IPSEC, LOCALCERTIFICATE, NULL, CFDATA },
    { SC_10_5, NETPROP IPSEC, LOCALIDENTIFIER, NULL, CFSTRING },
    { SC_10_5, NETPROP IPSEC, LOCALIDENTIFIER TYPE, NULL, CFSTRING },
    { SC_10_5, NETPROP IPSEC, SHAREDSECRET, NULL, CFSTRING },
    { SC_10_5, NETPROP IPSEC, SHAREDSECRET ENCRYPTION, NULL, CFSTRING },
    { SC_10_6_IPHONE_2_0, NETPROP IPSEC, CONNECTTIME, NULL, CFNUMBER },
    { SC_10_6_IPHONE_2_0, NETPROP IPSEC, REMOTEADDRESS, NULL, CFSTRING },
    { SC_10_6_IPHONE_2_0, NETPROP IPSEC, STATUS, STATUS, CFNUMBER },
    { SC_10_6_IPHONE_2_0, NETPROP IPSEC, XAUTH ENABLED, NULL, CFNUMBER_BOOL },
    { SC_10_6_IPHONE_2_0, NETPROP IPSEC, XAUTH NAME, NULL, CFSTRING },
    { SC_10_6_IPHONE_2_0, NETPROP IPSEC, XAUTH PASSWORD, NULL, CFSTRING },
    { SC_10_6_IPHONE_2_0, NETPROP IPSEC, XAUTH PASSWORD ENCRYPTION, NULL, CFSTRING },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP IPSEC, DISCONNECTONWAKE, NULL, CFNUMBER_BOOL },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP IPSEC, DISCONNECTONWAKETIMER, NULL, CFNUMBER },
    { COMMENT, "", NULL, NULL, NULL },
    { COMMENT, "--- " KEY_PREFIX NETPROP IPSEC AUTHENTICATIONMETHOD " values ---", NULL, NULL, NULL },
    { SC_10_5, NETVAL IPSEC AUTHENTICATIONMETHOD, SHAREDSECRET, NULL, NULL },
    { SC_10_5, NETVAL IPSEC AUTHENTICATIONMETHOD, CERTIFICATE, NULL, NULL },
    { SC_10_5, NETVAL IPSEC AUTHENTICATIONMETHOD, HYBRID, NULL, NULL },
    { COMMENT, "", NULL, NULL, NULL },
    { COMMENT, "--- " KEY_PREFIX NETPROP IPSEC LOCALIDENTIFIER TYPE " values ---", NULL, NULL, NULL },
    { SC_10_5, NETVAL IPSEC LOCALIDENTIFIER TYPE, KEYID, NULL, NULL },
    { COMMENT, "", NULL, NULL, NULL },
    { COMMENT, "--- " KEY_PREFIX NETPROP IPSEC SHAREDSECRET ENCRYPTION " values ---", NULL, NULL, NULL },
    { SC_10_5, NETVAL IPSEC SHAREDSECRET ENCRYPTION, KEYCHAIN, NULL, NULL },
    { COMMENT, "", NULL, NULL, NULL },
    { COMMENT, "--- " KEY_PREFIX NETPROP IPSEC XAUTH PASSWORD ENCRYPTION " values ---", NULL, NULL, NULL },
    { SC_10_6_IPHONE_2_0, NETVAL IPSEC XAUTH PASSWORD ENCRYPTION, KEYCHAIN, NULL, NULL },
    { SC_10_6_IPHONE_3_0, NETVAL IPSEC XAUTH PASSWORD ENCRYPTION, PROMPT, NULL, NULL },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP_PRIVATE, NETPROP IPSEC, KEY_PREFIX NETENT IPSEC " Entity Keys", NULL, NULL },

    { SC_10_6_IPHONE_3_0_PRIVATE, NETPROP IPSEC, LAST CAUSE, NULL, CFNUMBER },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },
    { COMMENT_PRIVATE, "--- " ONDEMAND ": ---", NULL, NULL, NULL },
    { SC_10_6_IPHONE_3_0_PRIVATE, NETPROP IPSEC, ONDEMAND ENABLED, NULL, CFNUMBER_BOOL },
    { SC_10_6_IPHONE_3_0_PRIVATE, NETPROP IPSEC, ONDEMAND MATCH DOMAINS ALWAYS, NULL, CFARRAY_CFSTRING },
    { SC_10_6_IPHONE_3_0_PRIVATE, NETPROP IPSEC, ONDEMAND MATCH DOMAINS ONRETRY, NULL, CFARRAY_CFSTRING },
    { SC_10_6_IPHONE_3_0_PRIVATE, NETPROP IPSEC, ONDEMAND MATCH DOMAINS NEVER, NULL, CFARRAY_CFSTRING },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },

  { GROUP, NETPROP IPV4, KEY_PREFIX NETENT IPV4 " Entity Keys", NULL, NULL },

    { SC_10_1, NETPROP IPV4, ADDRESSES, NULL, CFARRAY_CFSTRING },
    { SC_10_1, NETPROP IPV4, CONFIGMETHOD, NULL, CFSTRING },
    { SC_10_1, NETPROP IPV4, DHCPCLIENTID, NULL, CFSTRING },
    { SC_10_1, NETPROP IPV4, ROUTER, NULL, CFSTRING },
    { SC_10_1, NETPROP IPV4, SUBNETMASKS, NULL, CFARRAY_CFSTRING },
    { SC_10_1, NETPROP IPV4, DEST ADDRESSES, NULL, CFARRAY_CFSTRING },
    { SC_10_1, NETPROP IPV4, BROADCAST ADDRESSES, NULL, CFARRAY_CFSTRING },
    { COMMENT, "", NULL, NULL, NULL },
    { COMMENT, "--- " KEY_PREFIX NETPROP IPV4 CONFIGMETHOD " values ---", NULL, NULL, NULL },
    { SC_10_6_IPHONE_2_0, NETVAL IPV4 CONFIGMETHOD, AUTOMATIC, NULL, NULL },
    { SC_10_1, NETVAL IPV4 CONFIGMETHOD, BOOTP, NULL, NULL },
    { SC_10_1, NETVAL IPV4 CONFIGMETHOD, DHCP, NULL, NULL },
    { SC_10_1, NETVAL IPV4 CONFIGMETHOD, INFORM, NULL, NULL },
    { SC_10_2, NETVAL IPV4 CONFIGMETHOD, LINKLOCAL, NULL, NULL },
    { SC_10_1, NETVAL IPV4 CONFIGMETHOD, MANUAL, NULL, NULL },
    { SC_10_1, NETVAL IPV4 CONFIGMETHOD, PPP, NULL, NULL },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP_PRIVATE, NETPROP IPV4, KEY_PREFIX NETENT IPV4 " Entity Keys", NULL, NULL },
    { SC_10_10_IPHONE_8_0_PRIVATE, NETPROP IPV4, ADDITIONAL ROUTES, NULL, CFARRAY_CFDICTIONARY },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP IPV4, EXCLUDED ROUTES, NULL, CFARRAY_CFDICTIONARY },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP IPV4, INCLUDED ROUTES, NULL, CFARRAY_CFDICTIONARY },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },
    { COMMENT_PRIVATE, "--- " KEY_PREFIX NETPROP IPV4 CONFIGMETHOD " values ---", NULL, NULL, NULL },
    { SC_10_5_PRIVATE, NETVAL IPV4 CONFIGMETHOD, FAILOVER, NULL, NULL },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },
    { COMMENT_PRIVATE,
      "--- "
      KEY_PREFIX NETPROP IPV4 ADDITIONAL ROUTES ", "
      KEY_PREFIX NETPROP IPV4 EXCLUDED ROUTES ", "
      KEY_PREFIX NETPROP IPV4 INCLUDED ROUTES
      " [CFDictionary] keys ---", NULL, NULL, NULL },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP IPV4 ROUTE, DESTINATION ADDRESS, NULL, CFSTRING },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP IPV4 ROUTE, SUBNETMASK, NULL, CFSTRING },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP IPV4 ROUTE, GATEWAY ADDRESS, NULL, CFSTRING },
    { SC_10_10_IPHONE_8_0_PRIVATE, NETPROP IPV4 ROUTE, INTERFACENAME, NULL, CFSTRING },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },
    { SC_10_7_IPHONE_5_0_PRIVATE, NETPROP IPV4, ARP RESOLVED HARDWARE ADDRESS, NULL, CFSTRING },
    { SC_10_7_IPHONE_5_0_PRIVATE, NETPROP IPV4, ARP RESOLVED IP ADDRESS, NULL, CFSTRING },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },

  { GROUP, NETPROP IPV6, KEY_PREFIX NETENT IPV6 " Entity Keys", NULL, NULL },

    { SC_10_1, NETPROP IPV6, ADDRESSES, NULL, CFARRAY_CFSTRING },
    { SC_10_1, NETPROP IPV6, CONFIGMETHOD, NULL, CFSTRING },
    { SC_10_3, NETPROP IPV6, DEST ADDRESSES, NULL, CFARRAY_CFSTRING },
    { SC_10_3, NETPROP IPV6, FLAGS, NULL, CFNUMBER },
    { SC_10_3, NETPROP IPV6, PREFIXLENGTH, NULL, CFARRAY_CFNUMBER },
    { SC_10_3, NETPROP IPV6, ROUTER, NULL, CFSTRING },
    { COMMENT, "", NULL, NULL, NULL },
    { COMMENT, "--- " KEY_PREFIX NETPROP IPV6 CONFIGMETHOD " values ---", NULL, NULL, NULL },
    { SC_10_3, NETVAL IPV6 CONFIGMETHOD, AUTOMATIC, NULL, NULL },
    { SC_10_7_IPHONE_4_0, NETVAL IPV6 CONFIGMETHOD, LINKLOCAL, NULL, NULL },
    { SC_10_3, NETVAL IPV6 CONFIGMETHOD, MANUAL, NULL, NULL },
    { SC_10_3, NETVAL IPV6 CONFIGMETHOD, ROUTERADVERTISEMENT, NULL, NULL },
    { SC_10_3, NETVAL IPV6 CONFIGMETHOD, STF, NULL, NULL },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP_PRIVATE, NETPROP IPV6, KEY_PREFIX NETENT IPV6 " Entity Keys", NULL, NULL },
    { SC_10_10_IPHONE_8_0_PRIVATE, NETPROP IPV6, ADDITIONAL ROUTES, NULL, CFARRAY_CFDICTIONARY },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP IPV6, EXCLUDED ROUTES, NULL, CFARRAY_CFDICTIONARY },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP IPV6, INCLUDED ROUTES, NULL, CFARRAY_CFDICTIONARY },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },
    { COMMENT_PRIVATE,
      "--- "
      KEY_PREFIX NETPROP IPV6 ADDITIONAL ROUTES ", "
      KEY_PREFIX NETPROP IPV6 INCLUDED ROUTES ", "
      KEY_PREFIX NETPROP IPV6 EXCLUDED ROUTES
      " [CFDictionary] keys ---", NULL, NULL, NULL },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP IPV6 ROUTE, DESTINATION ADDRESS, NULL, CFSTRING },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP IPV6 ROUTE, PREFIXLENGTH, NULL, CFNUMBER },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP IPV6 ROUTE, GATEWAY ADDRESS, NULL, CFSTRING },
    { SC_10_10_IPHONE_8_0_PRIVATE, NETPROP IPV6 ROUTE, INTERFACENAME, NULL, CFSTRING },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },

  { GROUP, NETPROP STF, KEY_PREFIX NETENT STF " Entity Keys", NULL, NULL },

    { SC_10_3, NETPROP STF, RELAY, NULL, CFSTRING },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP, NETPROP LINK, KEY_PREFIX NETENT LINK " Entity Keys", NULL, NULL },

    { SC_10_1, NETPROP LINK, ACTIVE, NULL, CFBOOLEAN },
    { SC_10_2, NETPROP LINK, DETACHING, NULL, CFBOOLEAN },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP_PRIVATE, NETPROP LINK, KEY_PREFIX NETENT LINK " Entity Keys", NULL, NULL },
    { SC_10_10_IPHONE_8_0_PRIVATE, NETPROP LINK, EXPENSIVE, NULL, CFBOOLEAN },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },
    
  { GROUP_PRIVATE, NETPROP LINK, KEY_PREFIX NETENT LINKISSUES " Entity Keys", NULL, NULL },

    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP LINKISSUES, MODULEID, NULL, CFDATA },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP LINKISSUES, INFO, NULL, CFDATA },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP LINKISSUES, TIMESTAMP, NULL, CFDATE },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },

  { GROUP_PRIVATE, NETPROP LINK, KEY_PREFIX NETENT LINKQUALITY " Entity Keys", NULL, NULL },

    { SC_10_7_IPHONE_5_0_PRIVATE, NETPROP, LINKQUALITY, NULL, CFNUMBER},
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },

  { GROUP, NETPROP MODEM, KEY_PREFIX NETENT MODEM " (Hardware) Entity Keys", NULL, NULL },

    { SC_10_5, NETPROP MODEM, ACCESSPOINTNAME, NULL, CFSTRING },
    { SC_10_5, NETPROP MODEM, CONNECTION PERSONALITY, NULL, CFSTRING },
    { SC_10_1, NETPROP MODEM, CONNECTION SCRIPT, NULL, CFSTRING },
    { SC_10_2, NETPROP MODEM, CONNECTSPEED, NULL, CFNUMBER },
    { SC_10_1, NETPROP MODEM, DATACOMPRESSION, NULL, CFNUMBER_BOOL },
    { SC_10_5, NETPROP MODEM, DEVICE CONTEXTID, NULL, CFSTRING },
    { SC_10_5, NETPROP MODEM, DEVICE MODEL, NULL, CFSTRING },
    { SC_10_5, NETPROP MODEM, DEVICE VENDOR, NULL, CFSTRING },
    { SC_10_1, NETPROP MODEM, DIALMODE, NULL, CFSTRING },
    { SC_10_1, NETPROP MODEM, ERRORCORRECTION, NULL, CFNUMBER_BOOL },
    { SC_10_2, NETPROP MODEM, HOLD CALLWAITINGAUDIBLEALERT, NULL, CFNUMBER_BOOL },
    { SC_10_2, NETPROP MODEM, HOLD DISCONNECTONANSWER, NULL, CFNUMBER_BOOL },
    { SC_10_2, NETPROP MODEM, HOLD ENABLED, NULL, CFNUMBER_BOOL },
    { SC_10_2, NETPROP MODEM, HOLD REMINDER, NULL, CFNUMBER_BOOL },
    { SC_10_2, NETPROP MODEM, HOLD REMINDERTIME, NULL, CFNUMBER },
    { SC_10_2, NETPROP MODEM, NOTE, NULL, CFSTRING },
    { SC_10_1, NETPROP MODEM, PULSEDIAL, NULL, CFNUMBER_BOOL },
    { SC_10_1, NETPROP MODEM, SPEAKER, NULL, CFNUMBER_BOOL },
    { SC_10_1, NETPROP MODEM, SPEED, NULL, CFNUMBER },
    { COMMENT, "", NULL, NULL, NULL },
    { COMMENT, "--- " KEY_PREFIX NETPROP MODEM DIALMODE " values ---", NULL, NULL, NULL },
    { SC_10_1, NETVAL MODEM DIALMODE, IGNOREDIALTONE, NULL, NULL },
    { SC_10_1, NETVAL MODEM DIALMODE, MANUAL, NULL, NULL },
    { SC_10_1, NETVAL MODEM DIALMODE, WAITFORDIALTONE, NULL, NULL },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP_DEPRECATED, NETPROP NETINFO, KEY_PREFIX NETENT NETINFO " Entity Keys", NULL, NULL },

    { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
    { SC_10_1_10_5, NETPROP NETINFO, BINDINGMETHODS, NULL, CFSTRING },
    { SC_10_1_10_5, NETPROP NETINFO, SERVER ADDRESSES, NULL, CFARRAY_CFSTRING },
    { SC_10_1_10_5, NETPROP NETINFO, SERVER TAGS, NULL, CFARRAY_CFSTRING },
    { SC_10_1_10_5, NETPROP NETINFO, BROADCAST SERVER TAG, NULL, CFSTRING },
    { COMMENT_DEPRECATED, "", NULL, NULL, NULL },
    { COMMENT_DEPRECATED, "--- " KEY_PREFIX NETPROP NETINFO BINDINGMETHODS " values ---", NULL, NULL, NULL },
    { SC_10_1_10_5, NETVAL NETINFO BINDINGMETHODS, BROADCAST, NULL, NULL },
    { SC_10_1_10_5, NETVAL NETINFO BINDINGMETHODS, DHCP, NULL, NULL },
    { SC_10_1_10_5, NETVAL NETINFO BINDINGMETHODS, MANUAL, NULL, NULL },
    { COMMENT_DEPRECATED, "", NULL, NULL, NULL },
    { COMMENT_DEPRECATED, "--- " KEY_PREFIX NETPROP NETINFO BROADCAST SERVER TAG " default value ---", NULL, NULL, NULL },
    { SC_10_1_10_5, NETVAL NETINFO, DEFAULT SERVER TAG, "network", NULL },
    { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
    { COMMENT_DEPRECATED, "", NULL, NULL, NULL },

  { GROUP, NETPROP PPP, KEY_PREFIX NETENT PPP " Entity Keys", NULL, NULL },

    { SC_10_3, NETPROP PPP, ACSP ENABLED, NULL, CFNUMBER_BOOL },
    { SC_10_2, NETPROP PPP, CONNECTTIME, NULL, CFNUMBER },
    { SC_10_2, NETPROP PPP, DEVICE LAST CAUSE, NULL, CFNUMBER },
    { SC_10_1, NETPROP PPP, DIALONDEMAND, NULL, CFNUMBER_BOOL },
    { SC_10_4, NETPROP PPP, DISCONNECTONFASTUSERSWITCH, NULL, CFNUMBER_BOOL },
    { SC_10_1, NETPROP PPP, DISCONNECTONIDLE, NULL, CFNUMBER_BOOL },
    { SC_10_1, NETPROP PPP, DISCONNECTONIDLETIMER, NULL, CFNUMBER },
    { SC_10_1, NETPROP PPP, DISCONNECTONLOGOUT, NULL, CFNUMBER_BOOL },
    { SC_10_2, NETPROP PPP, DISCONNECTONSLEEP, NULL, CFNUMBER_BOOL },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP PPP, DISCONNECTONWAKE, NULL, CFNUMBER_BOOL },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP PPP, DISCONNECTONWAKETIMER, NULL, CFNUMBER },
    { SC_10_3, NETPROP PPP, DISCONNECTTIME, NULL, CFNUMBER },
    { SC_10_1, NETPROP PPP, IDLEREMINDERTIMER, NULL, CFNUMBER },
    { SC_10_1, NETPROP PPP, IDLEREMINDER, NULL, CFNUMBER_BOOL },
    { SC_10_2, NETPROP PPP, LAST CAUSE, NULL, CFNUMBER },
    { SC_10_1, NETPROP PPP, LOGFILE, NULL, CFSTRING },
    { SC_10_2, NETPROP PPP, PLUGINS, NULL, CFARRAY_CFSTRING },
    { SC_10_3, NETPROP PPP, RETRYCONNECTTIME, NULL, CFNUMBER },
    { SC_10_1, NETPROP PPP, SESSIONTIMER, NULL, CFNUMBER },
    { SC_10_2, NETPROP PPP, STATUS, NULL, CFNUMBER },
    { SC_10_2, NETPROP PPP, USE SESSIONTIMER, NULL, CFNUMBER_BOOL },
    { SC_10_1, NETPROP PPP, VERBOSELOGGING, NULL, CFNUMBER_BOOL },
    { COMMENT, "", NULL, NULL, NULL },

    { COMMENT, "--- " AUTH ": ---", NULL, NULL, NULL },
    { SC_10_3, NETPROP PPP, AUTH EAP PLUGINS, NULL, CFARRAY_CFSTRING },
    { SC_10_1, NETPROP PPP, AUTH NAME, NULL, CFSTRING },
    { SC_10_1, NETPROP PPP, AUTH PASSWORD, NULL, CFSTRING },
    { SC_10_1, NETPROP PPP, AUTH PASSWORD ENCRYPTION, NULL, CFSTRING },
    { SC_10_3, NETPROP PPP, AUTH PROMPT, NULL, CFSTRING },
    { SC_10_1, NETPROP PPP, AUTH PROTOCOL, NULL, CFARRAY_CFSTRING },
    { COMMENT, "", NULL, NULL, NULL },
    { COMMENT, "--- " KEY_PREFIX NETPROP PPP AUTH PASSWORD ENCRYPTION " values ---", NULL, NULL, NULL },
    { SC_10_3, NETVAL PPP AUTH PASSWORD ENCRYPTION, KEYCHAIN, NULL, NULL },
    { SC_10_5, NETVAL PPP AUTH PASSWORD ENCRYPTION, TOKEN, NULL, NULL },
    { COMMENT, "", NULL, NULL, NULL },
    { COMMENT, "--- " KEY_PREFIX NETPROP PPP AUTH PROMPT " values ---", NULL, NULL, NULL },
    { SC_10_3, NETVAL PPP AUTH PROMPT, BEFORE, NULL, CFSTRING },
    { SC_10_3, NETVAL PPP AUTH PROMPT, AFTER, NULL, CFSTRING },
    { COMMENT, "", NULL, NULL, NULL },
    { COMMENT, "--- " KEY_PREFIX NETPROP PPP AUTH PROTOCOL " values ---", NULL, NULL, NULL },
    { SC_10_1, NETVAL PPP AUTH PROTOCOL, CHAP, NULL, CFSTRING },
    { SC_10_3, NETVAL PPP AUTH PROTOCOL, EAP, NULL, CFSTRING },
    { SC_10_3, NETVAL PPP AUTH PROTOCOL, MSCHAP1, NULL, CFSTRING },
    { SC_10_3, NETVAL PPP AUTH PROTOCOL, MSCHAP2, NULL, CFSTRING },
    { SC_10_1, NETVAL PPP AUTH PROTOCOL, PAP, NULL, CFSTRING },
    { COMMENT, "", NULL, NULL, NULL },

    { COMMENT, "--- " COMM ": ---", NULL, NULL, NULL },
    { SC_10_1, NETPROP PPP, COMM ALTERNATE REMOTEADDRESS, NULL, CFSTRING },
    { SC_10_1, NETPROP PPP, COMM CONNECTDELAY, NULL, CFNUMBER },
    { SC_10_1, NETPROP PPP, COMM DISPLAYTERMINALWINDOW, NULL, CFNUMBER_BOOL },
    { SC_10_1, NETPROP PPP, COMM REDIALCOUNT, NULL, CFNUMBER },
    { SC_10_1, NETPROP PPP, COMM REDIAL ENABLED, NULL, CFNUMBER_BOOL },
    { SC_10_1, NETPROP PPP, COMM REDIALINTERVAL, NULL, CFNUMBER },
    { SC_10_1, NETPROP PPP, COMM REMOTEADDRESS, NULL, CFSTRING },
    { SC_10_1, NETPROP PPP, COMM TERMINALSCRIPT, NULL, CFSTRING },
    { SC_10_2, NETPROP PPP, COMM USE TERMINALSCRIPT, NULL, CFNUMBER_BOOL },
    { COMMENT, "", NULL, NULL, NULL },

    { COMMENT, "--- " CCP ": ---", NULL, NULL, NULL },
    { SC_10_2, NETPROP PPP, CCP ENABLED, NULL, CFNUMBER_BOOL },
    { SC_10_4, NETPROP PPP, CCP MPPE40 ENABLED, NULL, CFNUMBER_BOOL },
    { SC_10_4, NETPROP PPP, CCP MPPE128 ENABLED, NULL, CFNUMBER_BOOL },
    { COMMENT, "", NULL, NULL, NULL },

    { COMMENT, "--- " IPCP ": ---", NULL, NULL, NULL },
    { SC_10_1, NETPROP PPP, IPCP COMPRESSIONVJ, NULL, CFNUMBER_BOOL },
    { SC_10_4, NETPROP PPP, IPCP USE PEER DNS, NULL, CFNUMBER_BOOL },
    { COMMENT, "", NULL, NULL, NULL },

    { COMMENT, "--- " LCP ": ---", NULL, NULL, NULL },
    { SC_10_1, NETPROP PPP, LCP ECHO ENABLED, NULL, CFNUMBER_BOOL },
    { SC_10_1, NETPROP PPP, LCP ECHOFAILURE, NULL, CFNUMBER },
    { SC_10_1, NETPROP PPP, LCP ECHOINTERVAL, NULL, CFNUMBER },
    { SC_10_1, NETPROP PPP, LCP COMPRESSIONACFIELD, NULL, CFNUMBER_BOOL },
    { SC_10_1, NETPROP PPP, LCP COMPRESSIONPFIELD, NULL, CFNUMBER_BOOL },
    { SC_10_1, NETPROP PPP, LCP MRU, NULL, CFNUMBER },
    { SC_10_1, NETPROP PPP, LCP MTU, NULL, CFNUMBER },
    { SC_10_1, NETPROP PPP, LCP RECEIVEACCM, NULL, CFNUMBER },
    { SC_10_1, NETPROP PPP, LCP TRANSMITACCM, NULL, CFNUMBER },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP_PRIVATE, NETPROP PPP, KEY_PREFIX NETENT PPP " Entity Keys", NULL, NULL },

    { COMMENT_PRIVATE, "--- " ONDEMAND ": ---", NULL, NULL, NULL },
    { SC_10_5_PRIVATE, NETPROP PPP, ONDEMAND DOMAINS, NULL, CFARRAY_CFSTRING },
    { SC_10_5_PRIVATE, NETPROP PPP, ONDEMAND ENABLED, NULL, CFNUMBER_BOOL },
    { SC_10_5_PRIVATE, NETPROP PPP, ONDEMAND HOSTNAME, NULL, CFSTRING },    // DEPRECATED, use kSCNetworkConnectionSelectionOptionOnDemandHostName
    { SC_10_7_IPHONE_5_0_PRIVATE, NETPROP PPP, ONDEMAND MATCH DOMAINS ALWAYS, NULL, CFARRAY_CFSTRING },
    { SC_10_7_IPHONE_5_0_PRIVATE, NETPROP PPP, ONDEMAND MATCH DOMAINS ONRETRY, NULL, CFARRAY_CFSTRING },
    { SC_10_7_IPHONE_5_0_PRIVATE, NETPROP PPP, ONDEMAND MATCH DOMAINS NEVER, NULL, CFARRAY_CFSTRING },
    { SC_10_5_PRIVATE, NETPROP PPP, ONDEMAND MODE, NULL, CFSTRING },
    { SC_10_5_PRIVATE, NETPROP PPP, ONDEMAND PRIORITY, NULL, CFSTRING },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },
    { COMMENT_PRIVATE, "--- " KEY_PREFIX NETPROP PPP ONDEMAND MODE " values ---", NULL, NULL, NULL },
    { SC_10_5_PRIVATE, NETVAL PPP ONDEMAND MODE, AGGRESSIVE, NULL, NULL },
    { SC_10_5_PRIVATE, NETVAL PPP ONDEMAND MODE, CONSERVATIVE, NULL, NULL },
    { SC_10_5_PRIVATE, NETVAL PPP ONDEMAND MODE, COMPATIBLE, NULL, NULL },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },
    { COMMENT_PRIVATE, "--- " KEY_PREFIX NETPROP PPP ONDEMAND PRIORITY " values ---", NULL, NULL, NULL },
    { SC_10_5_PRIVATE, NETVAL PPP ONDEMAND PRIORITY, DEFAULT, NULL, NULL },
    { SC_10_5_PRIVATE, NETVAL PPP ONDEMAND PRIORITY, HIGH, NULL, NULL },
    { SC_10_5_PRIVATE, NETVAL PPP ONDEMAND PRIORITY, LOW, NULL, NULL },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },

  { GROUP, NETPROP PPPOE, KEY_PREFIX NETENT PPPOE " Entity Keys", NULL, NULL },

    { COMMENT, "* RESERVED FOR FUTURE USE *", NULL, NULL, NULL },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP, NETPROP PPPSERIAL, KEY_PREFIX NETENT PPPSERIAL " Entity Keys", NULL, NULL },

    { COMMENT, "* RESERVED FOR FUTURE USE *", NULL, NULL, NULL },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP, NETPROP PPTP, KEY_PREFIX NETENT PPTP " Entity Keys", NULL, NULL },

    { COMMENT, "* RESERVED FOR FUTURE USE *", NULL, NULL, NULL },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP, NETPROP L2TP, KEY_PREFIX NETENT L2TP " Entity Keys", NULL, NULL },

    { SC_10_3, NETPROP L2TP, IPSEC SHAREDSECRET, NULL, CFSTRING },
    { SC_10_3, NETPROP L2TP, IPSEC SHAREDSECRET ENCRYPTION, NULL, CFSTRING },
    { SC_10_3, NETPROP L2TP, TRANSPORT, NULL, CFSTRING },
    { COMMENT, "", NULL, NULL, NULL },
    { COMMENT, "--- " KEY_PREFIX NETPROP L2TP IPSEC SHAREDSECRET ENCRYPTION " values ---", NULL, NULL, NULL },
    { SC_10_3, NETVAL L2TP IPSEC SHAREDSECRET ENCRYPTION, KEYCHAIN, NULL, NULL },
    { COMMENT, "", NULL, NULL, NULL },
    { COMMENT, "--- " KEY_PREFIX NETPROP L2TP TRANSPORT " values ---", NULL, NULL, NULL },
    { SC_10_3, NETVAL L2TP TRANSPORT, IP, NULL, NULL },
    { SC_10_3, NETVAL L2TP TRANSPORT, IPSEC, NULL, NULL },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP, NETPROP PROXIES, KEY_PREFIX NETENT PROXIES " Entity Keys", NULL, NULL },

    { SC_10_1, NETPROP PROXIES, EXCEPTIONSLIST, NULL, CFARRAY_CFSTRING },
    { SC_10_4, NETPROP PROXIES, EXCLUDESIMPLEHOSTNAMES, NULL, CFNUMBER_BOOL },
    { SC_10_1, NETPROP PROXIES, FTP ENABLE, NULL, CFNUMBER_BOOL },
    { SC_10_1, NETPROP PROXIES, FTP PASSIVE, NULL, CFNUMBER_BOOL },
    { SC_10_1, NETPROP PROXIES, FTP PORT, NULL, CFNUMBER },
    { SC_10_1, NETPROP PROXIES, FTP PROXY, NULL, CFSTRING },
    { SC_10_1, NETPROP PROXIES, GOPHER ENABLE, NULL, CFNUMBER_BOOL },
    { SC_10_1, NETPROP PROXIES, GOPHER PORT, NULL, CFNUMBER },
    { SC_10_1, NETPROP PROXIES, GOPHER PROXY, NULL, CFSTRING },
    { SC_10_1, NETPROP PROXIES, HTTP ENABLE, NULL, CFNUMBER_BOOL },
    { SC_10_1, NETPROP PROXIES, HTTP PORT, NULL, CFNUMBER },
    { SC_10_1, NETPROP PROXIES, HTTP PROXY, NULL, CFSTRING },
    { SC_10_1, NETPROP PROXIES, HTTPS ENABLE, NULL, CFNUMBER_BOOL },
    { SC_10_1, NETPROP PROXIES, HTTPS PORT, NULL, CFNUMBER },
    { SC_10_1, NETPROP PROXIES, HTTPS PROXY, NULL, CFSTRING },
    { SC_10_1, NETPROP PROXIES, RTSP ENABLE, NULL, CFNUMBER_BOOL },
    { SC_10_1, NETPROP PROXIES, RTSP PORT, NULL, CFNUMBER },
    { SC_10_1, NETPROP PROXIES, RTSP PROXY, NULL, CFSTRING },
    { SC_10_1, NETPROP PROXIES, SOCKS ENABLE, NULL, CFNUMBER_BOOL },
    { SC_10_1, NETPROP PROXIES, SOCKS PORT, NULL, CFNUMBER },
    { SC_10_1, NETPROP PROXIES, SOCKS PROXY, NULL, CFSTRING },
    { SC_10_4, NETPROP PROXIES, PROXY AUTOCONFIG ENABLE, NULL, CFNUMBER_BOOL },
    { SC_10_7_IPHONE_4_0, NETPROP PROXIES, PROXY AUTOCONFIG JAVASCRIPT, NULL, CFSTRING },
    { SC_10_4, NETPROP PROXIES, PROXY AUTOCONFIG URLSTRING, NULL, CFSTRING },
    { SC_10_4, NETPROP PROXIES, PROXY AUTODISCOVERY ENABLE, NULL, CFNUMBER_BOOL },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP_PRIVATE, NETPROP PROXIES, KEY_PREFIX NETENT PROXIES " Entity Keys", NULL, NULL },

    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP PROXIES, BYPASS ALLOWED, NULL, CFNUMBER_BOOL },
    { SC_10_9_IPHONE_6_0_PRIVATE, NETPROP PROXIES, FALLBACK ALLOWED, NULL, CFNUMBER_BOOL },
    { SC_10_7_IPHONE_5_0_PRIVATE, NETPROP PROXIES, SUPPLEMENTAL MATCH DOMAINS, NULL, CFARRAY_CFSTRING},
    { SC_10_7_IPHONE_5_0_PRIVATE, NETPROP PROXIES, SUPPLEMENTAL MATCH ORDERS, NULL, CFARRAY_CFNUMBER},
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },
    { SC_10_7_IPHONE_5_0_PRIVATE, NETPROP PROXIES, SCOPED, "__SCOPED__", CFDICTIONARY},
    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP PROXIES, SERVICES, "__SERVICES__", CFDICTIONARY},
    { SC_10_7_IPHONE_5_0_PRIVATE, NETPROP PROXIES, SUPPLEMENTAL, "__SUPPLEMENTAL__", CFARRAY_CFDICTIONARY},
    { SC_10_7_IPHONE_5_0_PRIVATE, NETPROP PROXIES, SUPPLEMENTAL MATCH DOMAIN, "__MATCH_DOMAIN__", CFSTRING},
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },

  { GROUP_PRIVATE, NETPROP SERVICE, KEY_PREFIX NETENT SERVICE " Entity Keys", NULL, NULL },

    { SC_10_6_IPHONE_2_0_PRIVATE, NETPROP SERVICE, PRIMARYRANK, NULL, CFSTRING },
    { SC_10_6_IPHONE_2_0_PRIVATE, NETPROP SERVICE, USERDEFINEDNAME, NULL, CFSTRING },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },
    { COMMENT_PRIVATE, "--- " KEY_PREFIX NETPROP SERVICE PRIMARYRANK " values ---", NULL, NULL, NULL },
    { SC_10_6_IPHONE_2_0_PRIVATE, NETVAL SERVICE PRIMARYRANK, FIRST, NULL },
    { SC_10_6_IPHONE_2_0_PRIVATE, NETVAL SERVICE PRIMARYRANK, LAST, NULL },
    { SC_10_6_IPHONE_2_0_PRIVATE, NETVAL SERVICE PRIMARYRANK, NEVER, NULL },
    { SC_10_10_IPHONE_8_0_PRIVATE, NETVAL SERVICE PRIMARYRANK, SCOPED, NULL },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },

  { GROUP, NETPROP SMB, KEY_PREFIX NETENT SMB " Entity Keys", NULL, NULL },

    { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
    { SC_10_5, NETPROP SMB, NETBIOS NAME, NULL, CFSTRING },
    { SC_10_5, NETPROP SMB, NETBIOS NODE TYPE, NULL, CFSTRING },
    { SC_10_5_10_7, NETPROP SMB, NETBIOS SCOPE, NULL, CFSTRING },
    { SC_10_5, NETPROP SMB, WINS ADDRESSES, NULL, CFARRAY_CFSTRING },
    { SC_10_5, NETPROP SMB, WORKGROUP, NULL, CFSTRING },
    { COMMENT, "", NULL, NULL, NULL },
    { COMMENT, "--- " KEY_PREFIX NETPROP SMB NETBIOS NODE TYPE " values ---", NULL, NULL, NULL },
    { SC_10_5, NETVAL SMB NETBIOS NODE TYPE, BROADCAST, NULL },
    { SC_10_5, NETVAL SMB NETBIOS NODE TYPE, PEER, NULL },
    { SC_10_5, NETVAL SMB NETBIOS NODE TYPE, MIXED, NULL },
    { SC_10_5, NETVAL SMB NETBIOS NODE TYPE, HYBRID, NULL },
    { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP_PRIVATE, NETPROP VPN, KEY_PREFIX NETENT VPN " Entity Keys", NULL, NULL },

    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP VPN, APP RULES, NULL, CFARRAY_CFDICTIONARY },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP VPN, AUTH CREDENTIAL PASSWORD, NULL, CFSTRING },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP VPN, AUTH NAME, NULL, CFSTRING },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP VPN, AUTH PASSWORD, NULL, CFSTRING },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP VPN, AUTH PASSWORD ENCRYPTION, NULL, CFSTRING },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP VPN, AUTH PASSWORD PLUGIN TYPE, NULL, CFSTRING },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP VPN, AUTHENTICATIONMETHOD, NULL, CFSTRING },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP VPN, CONNECTTIME, NULL, CFSTRING },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP VPN, DISCONNECTONFASTUSERSWITCH, NULL, CFNUMBER_BOOL },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP VPN, DISCONNECTONIDLE, NULL, CFNUMBER_BOOL },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP VPN, DISCONNECTONIDLETIMER, NULL, CFNUMBER },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP VPN, DISCONNECTONLOGOUT, NULL, CFNUMBER_BOOL },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP VPN, DISCONNECTONSLEEP, NULL, CFNUMBER_BOOL },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP VPN, DISCONNECTONWAKE, NULL, CFNUMBER_BOOL },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP VPN, DISCONNECTONWAKETIMER, NULL, CFNUMBER },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP VPN, LOCALCERTIFICATE, NULL, CFDATA },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP VPN, LOGFILE, NULL, CFSTRING },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP VPN, MTU, NULL, CFNUMBER },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP VPN, ONDEMAND ENABLED, NULL, CFNUMBER_BOOL },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP VPN, ONDEMAND MATCH APP ENABLED, NULL, CFBOOLEAN },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP VPN, ONDEMAND MATCH DOMAINS ALWAYS, NULL, CFARRAY_CFSTRING },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP VPN, ONDEMAND MATCH DOMAINS ONRETRY, NULL, CFARRAY_CFSTRING },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP VPN, ONDEMAND MATCH DOMAINS NEVER, NULL, CFARRAY_CFSTRING },
    { SC_10_8_IPHONE_6_0_PRIVATE, NETPROP VPN, ONDEMAND RULES, NULL, CFARRAY_CFDICTIONARY },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP VPN, ONDEMAND SUSPENDED, NULL, CFNUMBER },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP VPN, PLUGIN CAPABILITY, NULL, CFSTRING },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP VPN, REMOTEADDRESS, NULL, CFSTRING },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP VPN, STATUS, NULL, CFNUMBER },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETPROP VPN, VERBOSELOGGING, NULL, CFNUMBER_BOOL },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },
    { COMMENT_PRIVATE, "--- " KEY_PREFIX NETPROP VPN APP RULES  " [CFDictionary] keys ---", NULL, NULL, NULL },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETVAL VPN APP RULE, ACCOUNT IDENTIFIER MATCH, NULL, CFARRAY_CFSTRING },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETVAL VPN APP RULE, DNS DOMAIN MATCH, NULL, CFARRAY_CFSTRING },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETVAL VPN APP RULE, EXECUTABLE MATCH, NULL, CFARRAY_CFDICTIONARY },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETVAL VPN APP RULE, IDENTIFIER, NULL, CFSTRING },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },
    { COMMENT_PRIVATE, "--- " KEY_PREFIX NETVAL VPN APP RULE EXECUTABLE MATCH " [CFDictionary] keys ---", NULL, NULL, NULL },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETVAL VPN APP RULE EXECUTABLE, DESIGNATED REQUIREMENT, NULL, CFSTRING },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETVAL VPN APP RULE EXECUTABLE, SIGNING IDENTIFIER, NULL, CFSTRING },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETVAL VPN APP RULE EXECUTABLE, UUID, NULL, CFSTRING },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },
    { COMMENT_PRIVATE, "--- " KEY_PREFIX NETPROP VPN AUTHENTICATIONMETHOD " values ---", NULL, NULL, NULL },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETVAL VPN AUTHENTICATIONMETHOD, PASSWORD, NULL, NULL },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETVAL VPN AUTHENTICATIONMETHOD, CERTIFICATE, NULL, NULL },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },
    { COMMENT_PRIVATE, "--- " KEY_PREFIX NETPROP VPN AUTH PASSWORD ENCRYPTION " values ---", NULL, NULL, NULL },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETVAL VPN AUTH PASSWORD ENCRYPTION, EXTERNAL, NULL, NULL },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETVAL VPN AUTH PASSWORD ENCRYPTION, KEYCHAIN, NULL, NULL },
    { SC_10_7_IPHONE_4_0_PRIVATE, NETVAL VPN AUTH PASSWORD ENCRYPTION, PROMPT, NULL, NULL },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },
    { COMMENT_PRIVATE, "--- " KEY_PREFIX NETPROP VPN ONDEMAND RULES " [CFDictionary] keys ---", NULL, NULL, NULL },
    { SC_10_8_IPHONE_6_0_PRIVATE, NETPROP VPN ONDEMAND RULE, ACTION, NULL, CFSTRING },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP VPN ONDEMAND RULE, ACTION PARAMETERS, NULL, CFARRAY_CFDICTIONARY },
    { SC_10_8_IPHONE_6_0_PRIVATE, NETPROP VPN ONDEMAND RULE, DNS DOMAIN MATCH, NULL, CFARRAY_CFSTRING },
    { SC_10_8_IPHONE_6_0_PRIVATE, NETPROP VPN ONDEMAND RULE, DNS SERVER ADDRESS MATCH, NULL, CFARRAY_CFSTRING },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP VPN ONDEMAND RULE, SSID MATCH, NULL, CFARRAY_CFSTRING },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP VPN ONDEMAND RULE, INTERFACE TYPE MATCH, NULL, CFSTRING },
    { SC_10_8_IPHONE_6_0_PRIVATE, NETPROP VPN ONDEMAND RULE, URLSTRING PROBE, NULL, CFSTRING },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },
    { COMMENT_PRIVATE, "--- " KEY_PREFIX NETPROP VPN ONDEMAND RULE ACTION " values ---", NULL, NULL, NULL },
    { SC_10_8_IPHONE_6_0_PRIVATE, NETVAL VPN ONDEMAND RULE ACTION, ALLOW, NULL, NULL },
    { SC_10_8_IPHONE_6_0_PRIVATE, NETVAL VPN ONDEMAND RULE ACTION, IGNORE, NULL, NULL },
    { SC_10_8_IPHONE_6_0_PRIVATE, NETVAL VPN ONDEMAND RULE ACTION, CONNECT, NULL, NULL },
    { SC_10_8_IPHONE_6_0_PRIVATE, NETVAL VPN ONDEMAND RULE ACTION, DISCONNECT, NULL, NULL },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETVAL VPN ONDEMAND RULE ACTION, EVALUATE CONNECTION, NULL, NULL },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },
    { COMMENT_PRIVATE, "--- " KEY_PREFIX NETPROP VPN ONDEMAND RULE ACTION PARAMETERS " [CFDictionary] keys ---", NULL, NULL, NULL },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP VPN ONDEMAND RULE ACTION PARAMETERS, DOMAIN ACTION, NULL, CFSTRING },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP VPN ONDEMAND RULE ACTION PARAMETERS, DOMAINS, NULL, CFARRAY_CFSTRING },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP VPN ONDEMAND RULE ACTION PARAMETERS, REQUIRED DNS SERVERS, NULL, CFARRAY_CFSTRING },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETPROP VPN ONDEMAND RULE ACTION PARAMETERS, REQUIRED URLSTRING PROBE, NULL, CFSTRING },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },
    { COMMENT_PRIVATE, "--- " KEY_PREFIX NETPROP VPN ONDEMAND RULE ACTION PARAMETERS DOMAIN ACTION " values ---", NULL, NULL, NULL },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETVAL VPN ONDEMAND RULE ACTION PARAMETERS DOMAIN ACTION, CONNECT IFNEEDED, NULL, NULL },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETVAL VPN ONDEMAND RULE ACTION PARAMETERS DOMAIN ACTION, NEVER CONNECT, NULL, NULL },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },
    { COMMENT_PRIVATE, "--- " KEY_PREFIX NETPROP VPN ONDEMAND RULE INTERFACE TYPE MATCH " values ---", NULL, NULL, NULL },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETVAL VPN ONDEMAND RULE INTERFACE TYPE MATCH, ETHERNET, NULL, NULL },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETVAL VPN ONDEMAND RULE INTERFACE TYPE MATCH, WIFI, NULL, NULL },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },
    { COMMENT_PRIVATE, "--- " KEY_PREFIX NETPROP VPN PLUGIN CAPABILITY " values ---", NULL, NULL, NULL },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETVAL VPN PLUGIN CAPABILITY, AUTH, NULL, NULL },
    { SC_10_9_IPHONE_7_0_PRIVATE, NETVAL VPN PLUGIN CAPABILITY, CONNECT, NULL, NULL },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },

  { GROUP, USERSENT CONSOLEUSER, KEY_PREFIX COMP USERS " Entity Keys", NULL, NULL },

    { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
    { SC_10_1, USERSENT, CONSOLEUSER, NULL, NULL },
    { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP, SYSTEMPROP COMPUTERNAME, KEY_PREFIX COMP SYSTEM " Properties", NULL, NULL },

    { SC_10_1, SYSTEMPROP, COMPUTERNAME, NULL, CFSTRING },
    { SC_10_1, SYSTEMPROP, COMPUTERNAME ENCODING, NULL, CFNUMBER },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP_PRIVATE, SYSTEMPROP COMPUTERNAME, KEY_PREFIX COMP SYSTEM " Properties", NULL, NULL },

    { SC_10_5_PRIVATE, SYSTEMPROP, COMPUTERNAME REGION, NULL, CFNUMBER },
    { SC_10_5_PRIVATE, SYSTEMPROP, HOSTNAME, NULL, CFSTRING },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },

  { GROUP, DYNAMICSTORE DOMAIN, "SCDynamicStore \"domain\" prefixes", NULL, NULL },

    { SC_10_1, DYNAMICSTORE DOMAIN, FILE, "File:", NULL },
    { SC_10_1, DYNAMICSTORE DOMAIN, PLUGIN, "Plugin:", NULL },
    { SC_10_1, DYNAMICSTORE DOMAIN, SETUP, "Setup:", NULL },
    { SC_10_1, DYNAMICSTORE DOMAIN, STATE, "State:", NULL },
    { SC_10_1, DYNAMICSTORE DOMAIN, PREFS, "Prefs:", NULL },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP, DYNAMICSTORE SETUPPROP, "Preference (\"location\") Keys", NULL, NULL },

    { SC_10_1, DYNAMICSTORE SETUPPROP, CURRENTSET, NULL, CFSTRING },
    { SC_10_1, DYNAMICSTORE SETUPPROP, LAST UPDATED, NULL, NULL },
    { COMMENT, "", NULL, NULL, NULL },

  { GROUP, DYNAMICSTORE NETPROP, "Common/shared Keys", NULL, NULL },

    { SC_10_1, DYNAMICSTORE NETPROP, INTERFACES, NULL, CFARRAY_CFSTRING },
    { SC_10_1, DYNAMICSTORE NETPROP, PRIMARYINTERFACE, NULL, CFSTRING },
    { SC_10_1, DYNAMICSTORE NETPROP, PRIMARYSERVICE, NULL, CFSTRING },
    { SC_10_1, DYNAMICSTORE NETPROP, SERVICEIDS, NULL, CFARRAY_CFSTRING },
//  { COMMENT, "", NULL, NULL, NULL },

  { GROUP_PRIVATE, VIRTUALNETWORKINTERFACES, "Virtual Network Interface Keys", NULL, NULL },

    { SC_10_5_PRIVATE, VIRTUALPROP BOND, INTERFACES, NULL, CFARRAY_CFSTRING },
    { SC_10_5_PRIVATE, VIRTUALPROP BOND, MODE, NULL, CFNUMBER },
    { SC_10_5_PRIVATE, VIRTUALPROP BOND, OPTIONS, NULL, CFDICTIONARY },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },
    { SC_10_7_IPHONE_4_0_PRIVATE, VIRTUALPROP BRIDGE, INTERFACES, NULL, CFARRAY_CFSTRING },
    { SC_10_7_IPHONE_4_0_PRIVATE, VIRTUALPROP BRIDGE, OPTIONS, NULL, CFDICTIONARY },
    { COMMENT_PRIVATE, "", NULL, NULL, NULL },
    { SC_10_5_PRIVATE, VIRTUALPROP VLAN, INTERFACE, NULL, CFSTRING },
    { SC_10_5_PRIVATE, VIRTUALPROP VLAN, TAG, NULL, CFNUMBER },
    { SC_10_5_PRIVATE, VIRTUALPROP VLAN, OPTIONS, NULL, CFDICTIONARY },
//  { COMMENT_PRIVATE, "", NULL, NULL, NULL },

//{ GROUP, "DEPRECATED", "Deprecated schema definition keys", NULL, NULL },

    { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
    { SC_10_1_10_4, USERSPROP CONSOLEUSER, NAME, NULL, CFSTRING },
    { SC_10_1_10_4, USERSPROP CONSOLEUSER, UID, NULL, CFNUMBER },
    { SC_10_1_10_4, USERSPROP CONSOLEUSER, GID, NULL, CFNUMBER },
    { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
//  { COMMENT, "", NULL, NULL, NULL },

    { END, NULL, NULL, NULL, NULL },
};

static int	maxkbuf		= 0;
static char	*maxkstr	= NULL;
static int	maxvbuf		= 0;
static char	*maxvstr	= NULL;

static __inline__ void
setmax(int *max, char **maxstr, char *str)
{
    int l;

    l = strlen(str);
    if (l > *max) {
	if (*maxstr) free(*maxstr);
	*maxstr = strdup(str);
	*max = l;
    }
    return;
}

enum {
    gen_header_e,
    gen_comments_e,
    gen_comments_private_e,
    gen_headerdoc_e,
    gen_headerdoc_private_e,
    gen_hfile_e,
    gen_hfile_private_e,
    gen_cfile_e,
};

void
print_comment(schemaDefinition *def)
{
	char kbuf[256];
	char vbuf[256];

	snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
		 def->prefix, def->key);
	snprintf(vbuf, sizeof(vbuf), "\"%s\"",
		 def->value ? def->value : def->key);

	if (def->type)
	    printf(" *   %-50s %-30s %s\n",
		   kbuf, vbuf, def->type);
	else
	    printf(" *   %-50s %s\n",
		   kbuf, vbuf);

	return;
}

void
print_define(schemaDefinition *def)
{
	printf("%s\t%s\n", def->prefix, def->key);
	return;
}

void
print_headerdoc(schemaDefinition *def)
{
	char kbuf[256];
	char vbuf[256];

	snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
		 def->prefix, def->key);
	setmax(&maxkbuf, &maxkstr, kbuf);

	snprintf(vbuf, sizeof(vbuf), "\"%s\"",
		 def->value ? def->value : def->key);
	setmax(&maxvbuf, &maxvstr, vbuf);

	printf("\n");

	printf("/*!\n");
	printf("  @const %s\n", kbuf);
	switch (def->control) {
	    case SC_10_1:
		printf("  @availability Introduced in Mac OS X 10.1.\n");
		break;
	    case SC_10_2:
		printf("  @availability Introduced in Mac OS X 10.2.\n");
		break;
	    case SC_10_3:
		printf("  @availability Introduced in Mac OS X 10.3.\n");
		break;
	    case SC_10_1_10_4:
		printf("  @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.4.\n");
		break;
	    case SC_10_4:
		printf("  @availability Introduced in Mac OS X 10.4.\n");
		break;
	    case SC_10_1_10_5:
		printf("  @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.5.\n");
		break;
	    case SC_10_5:
		printf("  @availability Introduced in Mac OS X 10.5.\n");
		break;
	    case SC_10_5_10_7:
		printf("  @availability Introduced in Mac OS X 10.5, but later deprecated in Mac OS X 10.7.\n");
		break;
	    case SC_10_5_PRIVATE:
		printf("  @availability Introduced in Mac OS X 10.5.\n");
		break;
	    case SC_10_1_10_6:
		printf("  @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.6.\n");
		break;
	    case SC_10_2_10_6:
		printf("  @availability Introduced in Mac OS X 10.2, but later deprecated in Mac OS X 10.6.\n");
		break;
	    case SC_10_1_10_9:
		printf("  @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.9.\n");
		break;
	    case SC_10_2_10_9:
		printf("  @availability Introduced in Mac OS X 10.2, but later deprecated in Mac OS X 10.9.\n");
		break;
	    case SC_10_3_10_9:
		printf("  @availability Introduced in Mac OS X 10.3, but later deprecated in Mac OS X 10.9.\n");
		break;
	    case SC_10_4_10_9:
		printf("  @availability Introduced in Mac OS X 10.4, but later deprecated in Mac OS X 10.9.\n");
		break;
	    case SC_10_6_IPHONE_2_0:
	    case SC_10_6_IPHONE_2_0_PRIVATE:
		printf("  @availability Introduced in Mac OS X 10.6.\n");
		break;
	    case SC_10_6_IPHONE_3_0:
	    case SC_10_6_IPHONE_3_0_PRIVATE:
		printf("  @availability Introduced in Mac OS X 10.6.\n");
		break;
	    case SC_10_7_IPHONE_4_0:
	    case SC_10_7_IPHONE_4_0_PRIVATE:
	    case SC_10_7_IPHONE_5_0_PRIVATE:
		printf("  @availability Introduced in Mac OS X 10.7.\n");
		break;
	    case SC_10_8_IPHONE_6_0_PRIVATE:
		printf("  @availability Introduced in Mac OS X 10.8.\n");
		break;
	    case SC_10_9_IPHONE_6_0_PRIVATE:
	    case SC_10_9_IPHONE_7_0_PRIVATE:
		printf("  @availability Introduced in Mac OS X 10.9.\n");
		break;
	    case SC_10_10_IPHONE_7_0_PRIVATE:
	    case SC_10_10_IPHONE_8_0_PRIVATE:
		printf("  @availability Introduced in Mac OS X 10.10.\n");
		break;
	    case SC_IPHONE_2_0_PRIVATE:
		printf("  @availability Introduced in iPhone OS 2.0.\n");
		break;
	}
	printf(" */\n");
	printf("extern const CFStringRef %s;\n", kbuf);

	return;
}

void
print_hfile(schemaDefinition *def)
{
	char kbuf[256];
	char vbuf[256];

	snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
		 def->prefix, def->key);
	setmax(&maxkbuf, &maxkstr, kbuf);

	snprintf(vbuf, sizeof(vbuf), "\"%s\"",
		 def->value ? def->value : def->key);
	setmax(&maxvbuf, &maxvstr, vbuf);

	printf("\n");

	switch (def->control) {
	    case SC_10_1:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))\n", kbuf);
		break;
	    case SC_10_2:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))\n", kbuf);
		break;
	    case SC_10_3:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))\n", kbuf);
		break;
	    case SC_10_1_10_4:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA))\n", kbuf);
		break;
	    case SC_10_4:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/))\n", kbuf);
		break;
	    case SC_10_1_10_5:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA))\n", kbuf);
		break;
	    case SC_10_5:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))\n", kbuf);
		break;
	    case SC_10_5_10_7:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5,__MAC_10_7,__IPHONE_NA,__IPHONE_NA))\n", kbuf);
		break;
	    case SC_10_5_PRIVATE:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))\n", kbuf);
		break;
	    case SC_10_1_10_6:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_6,__IPHONE_NA,__IPHONE_NA))\n", kbuf);
		break;
	    case SC_10_2_10_6:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2,__MAC_10_6,__IPHONE_NA,__IPHONE_NA))\n", kbuf);
		break;
	    case SC_10_1_10_9:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_9,__IPHONE_2_0/*SPI*/,__IPHONE_FUTURE/*SPI*/))\n", kbuf);
		break;
	    case SC_10_2_10_9:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2,__MAC_10_9,__IPHONE_2_0/*SPI*/,__IPHONE_FUTURE/*SPI*/))\n", kbuf);
		break;
	    case SC_10_3_10_9:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3,__MAC_10_9,__IPHONE_2_0/*SPI*/,__IPHONE_FUTURE/*SPI*/))\n", kbuf);
		break;
	    case SC_10_4_10_9:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4,__MAC_10_9,__IPHONE_2_0/*SPI*/,__IPHONE_FUTURE/*SPI*/))\n", kbuf);
		break;
	    case SC_10_6_IPHONE_2_0:
	    case SC_10_6_IPHONE_2_0_PRIVATE:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0/*SPI*/))\n", kbuf);
		break;
	    case SC_10_6_IPHONE_3_0:
	    case SC_10_6_IPHONE_3_0_PRIVATE:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0/*SPI*/))\n", kbuf);
		break;
	    case SC_10_7_IPHONE_4_0:
	    case SC_10_7_IPHONE_4_0_PRIVATE:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0/*SPI*/))\n", kbuf);
		break;
	    case SC_10_7_IPHONE_5_0_PRIVATE:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_5_0/*SPI*/))\n", kbuf);
		break;
	    case SC_10_8_IPHONE_6_0_PRIVATE:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_8,__IPHONE_6_0/*SPI*/))\n", kbuf);
		break;
	    case SC_10_9_IPHONE_6_0_PRIVATE:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_6_0/*SPI*/))\n", kbuf);
		break;
	    case SC_10_9_IPHONE_7_0_PRIVATE:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0/*SPI*/))\n", kbuf);
		break;
	    case SC_10_10_IPHONE_7_0_PRIVATE:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_10,__IPHONE_7_0/*SPI*/))\n", kbuf);
		break;
	    case SC_10_10_IPHONE_8_0_PRIVATE:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_10,__IPHONE_8_0/*SPI*/))\n", kbuf);
		break;
	    case SC_IPHONE_2_0_PRIVATE:
		printf("  " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_2_0/*SPI*/))\n", kbuf);
		break;
	    default:
		printf("  " SC_SCHEMA_DECLARATION "(%s,)\n", kbuf);
		break;
	}

	printf("  #define %-48s              \\\n",
	       kbuf);
	printf("	  " SC_SCHEMA_KV "(%-48s \\\n",
	       kbuf);
	printf("		      ,%-48s \\\n",
	       vbuf);
	printf("		      ,%-48s )\n",
	       def->type ? def->type : "");

	return;
}

void
dump_names(int type)
{
    int i;

    for (i = 0; TRUE; i++) {
	switch (names[i].control) {
	    case END: {
		goto done;
	    }

	    case COMMENT: {
		switch (type) {
		    case gen_comments_e:
			if (names[i].prefix) {
			    if (strlen(names[i].prefix) > 0)
				printf(" *   %s\n", names[i].prefix);
			    else
				printf(" *\n");
			}
			break;
		    default:
			break;
		}
		break;
	    }

	    case COMMENT_PRIVATE: {
		switch (type) {
		    case gen_comments_private_e:
			if (names[i].prefix) {
			    if (strlen(names[i].prefix) > 0)
				printf(" *   %s\n", names[i].prefix);
			    else
				printf(" *\n");
			}
			break;
		    default:
			break;
		}
		break;
	    }

	    case COMMENT_DEPRECATED: {
		break;
	    }

	    case DEFINE: {
		switch (type) {
		    case gen_hfile_e:
			printf("\n");
			print_define(&names[i]);
			break;
		    case gen_cfile_e:
			if ((strcmp(names[i].prefix, "#if") == 0) ||
			    (strcmp(names[i].prefix, "#ifdef") == 0) ||
			    (strcmp(names[i].prefix, "#ifndef") == 0))
			    printf("\n");
			print_define(&names[i]);
			if (strcmp(names[i].prefix, "#endif") == 0)
			    printf("\n");
			break;
		    default:
			break;
		}
		break;
	    }

	    case DEFINE_PRIVATE: {
		switch (type) {
		    case gen_hfile_private_e:
			printf("\n");
			print_define(&names[i]);
			break;
		    case gen_cfile_e:
			if ((strcmp(names[i].prefix, "#if") == 0) ||
			    (strcmp(names[i].prefix, "#ifdef") == 0) ||
			    (strcmp(names[i].prefix, "#ifndef") == 0))
			    printf("\n");
			print_define(&names[i]);
			if (strcmp(names[i].prefix, "#endif") == 0)
			    printf("\n");
			break;
		    default:
			break;
		}
		break;
	    }

	    case GROUP:
	    case GROUP_DEPRECATED: {
		switch (type) {
		    case gen_comments_e:
			if (names[i].control == GROUP) {
				if (names[i].key)
				    printf(" * %s\n *\n", names[i].key);
			}
			break;
		    case gen_headerdoc_e:
			if (names[i].prefix)
			    printf("\n/*!\n  @group %s\n */\n", names[i].key);
			break;
		    default:
			break;
		}
		break;
	    }

	    case GROUP_PRIVATE: {
		switch (type) {
		    case gen_comments_private_e:
			if (names[i].key)
			    printf(" * %s\n *\n", names[i].key);
			break;
		    case gen_headerdoc_private_e:
			if (names[i].prefix)
			    printf("\n/*!\n  @group %s\n */\n", names[i].key);
			break;
		    default:
			break;
		}
		break;
	    }

	    default: {
		char kbuf[256];
		char vbuf[256];

		switch (type) {
		    case gen_header_e:
			snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
				 names[i].prefix, names[i].key);

			if (names[i].value)
			    snprintf(vbuf, sizeof(vbuf), "SCSTR(\"%s\")",
				     names[i].value);
			else
			    snprintf(vbuf, sizeof(vbuf), "SCSTR(\"%s\")",
				     names[i].key);

			printf("#define %-50s %s\n",
			       kbuf, vbuf);
			break;

		    case gen_comments_e:
			switch (names[i].control) {
			    case SC_10_1_10_4:
			    case SC_10_1_10_5:
			    case SC_10_1_10_6:
			    case SC_10_2_10_6:
			    case SC_10_1_10_9:
			    case SC_10_2_10_9:
			    case SC_10_3_10_9:
			    case SC_10_4_10_9:
				// don't report deprecated keys
				break;
			    case SC_10_5_PRIVATE:
			    case SC_10_6_IPHONE_2_0_PRIVATE:
			    case SC_10_6_IPHONE_3_0_PRIVATE:
			    case SC_10_7_IPHONE_4_0_PRIVATE:
			    case SC_10_7_IPHONE_5_0_PRIVATE:
			    case SC_10_8_IPHONE_6_0_PRIVATE:
			    case SC_10_9_IPHONE_6_0_PRIVATE:
			    case SC_10_9_IPHONE_7_0_PRIVATE:
			    case SC_10_10_IPHONE_7_0_PRIVATE:
			    case SC_10_10_IPHONE_8_0_PRIVATE:
			    case SC_IPHONE_2_0_PRIVATE:
				// don't report private definitions
				break;
			    default:
				print_comment(&names[i]);
				break;
			}
			break;
		    case gen_comments_private_e:
			switch (names[i].control) {
			    case SC_10_1_10_4:
			    case SC_10_1_10_5:
			    case SC_10_1_10_6:
			    case SC_10_2_10_6:
			    case SC_10_1_10_9:
			    case SC_10_2_10_9:
			    case SC_10_3_10_9:
			    case SC_10_4_10_9:
				// don't report deprecated keys
				break;
			    case SC_10_5_PRIVATE:
			    case SC_10_6_IPHONE_2_0_PRIVATE:
			    case SC_10_6_IPHONE_3_0_PRIVATE:
			    case SC_10_7_IPHONE_4_0_PRIVATE:
			    case SC_10_7_IPHONE_5_0_PRIVATE:
			    case SC_10_8_IPHONE_6_0_PRIVATE:
			    case SC_10_9_IPHONE_6_0_PRIVATE:
			    case SC_10_9_IPHONE_7_0_PRIVATE:
			    case SC_10_10_IPHONE_7_0_PRIVATE:
			    case SC_10_10_IPHONE_8_0_PRIVATE:
			    case SC_IPHONE_2_0_PRIVATE:
				print_comment(&names[i]);
				break;
			    default:
				// don't report public definitions
				break;
			}
			break;

		    case gen_headerdoc_e:
			switch (names[i].control) {
			    case SC_10_5_PRIVATE:
			    case SC_10_6_IPHONE_2_0_PRIVATE:
			    case SC_10_6_IPHONE_3_0_PRIVATE:
			    case SC_10_7_IPHONE_4_0_PRIVATE:
			    case SC_10_7_IPHONE_5_0_PRIVATE:
			    case SC_10_8_IPHONE_6_0_PRIVATE:
			    case SC_10_9_IPHONE_6_0_PRIVATE:
			    case SC_10_9_IPHONE_7_0_PRIVATE:
			    case SC_10_10_IPHONE_7_0_PRIVATE:
			    case SC_10_10_IPHONE_8_0_PRIVATE:
			    case SC_IPHONE_2_0_PRIVATE:
				// don't report private definitions
				break;
			    default:
				print_headerdoc(&names[i]);
				break;
			}
			break;
		    case gen_headerdoc_private_e:
			switch (names[i].control) {
			    case SC_10_5_PRIVATE:
			    case SC_10_6_IPHONE_2_0_PRIVATE:
			    case SC_10_6_IPHONE_3_0_PRIVATE:
			    case SC_10_7_IPHONE_4_0_PRIVATE:
			    case SC_10_7_IPHONE_5_0_PRIVATE:
			    case SC_10_8_IPHONE_6_0_PRIVATE:
			    case SC_10_9_IPHONE_6_0_PRIVATE:
			    case SC_10_9_IPHONE_7_0_PRIVATE:
			    case SC_10_10_IPHONE_7_0_PRIVATE:
			    case SC_10_10_IPHONE_8_0_PRIVATE:
			    case SC_IPHONE_2_0_PRIVATE:
				print_headerdoc(&names[i]);
				break;
			    default:
				// don't report public definitions
				break;
			}
			break;

		    case gen_hfile_e:
			switch (names[i].control) {
			    case SC_10_5_PRIVATE:
			    case SC_10_6_IPHONE_2_0_PRIVATE:
			    case SC_10_6_IPHONE_3_0_PRIVATE:
			    case SC_10_7_IPHONE_4_0_PRIVATE:
			    case SC_10_7_IPHONE_5_0_PRIVATE:
			    case SC_10_8_IPHONE_6_0_PRIVATE:
			    case SC_10_9_IPHONE_6_0_PRIVATE:
			    case SC_10_9_IPHONE_7_0_PRIVATE:
			    case SC_10_10_IPHONE_7_0_PRIVATE:
			    case SC_10_10_IPHONE_8_0_PRIVATE:
			    case SC_IPHONE_2_0_PRIVATE:
				break;
				// don't report private definitions
			    default:
				print_hfile(&names[i]);
				break;
			}
			break;
		    case gen_hfile_private_e:
			switch (names[i].control) {
			    case SC_10_5_PRIVATE:
			    case SC_10_6_IPHONE_2_0_PRIVATE:
			    case SC_10_6_IPHONE_3_0_PRIVATE:
			    case SC_10_7_IPHONE_4_0_PRIVATE:
			    case SC_10_7_IPHONE_5_0_PRIVATE:
			    case SC_10_8_IPHONE_6_0_PRIVATE:
			    case SC_10_9_IPHONE_6_0_PRIVATE:
			    case SC_10_9_IPHONE_7_0_PRIVATE:
			    case SC_10_10_IPHONE_7_0_PRIVATE:
			    case SC_10_10_IPHONE_8_0_PRIVATE:
			    case SC_IPHONE_2_0_PRIVATE:
				print_hfile(&names[i]);
				break;
			    default:
				// don't report public definitions
				break;
			}
			break;

		    case gen_cfile_e:
			snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
				 names[i].prefix, names[i].key);

			if (names[i].value)
			    printf("const CFStringRef %-48s = CFSTR(\"%s\");\n",
				   kbuf, names[i].value);
			else
			    printf("const CFStringRef %-48s = CFSTR(\"%s\");\n",
				   kbuf, names[i].key);
			break;
		    default:
			break;
		}
		break;
	    }
	}
    }
 done:
    switch (type) {
	case gen_hfile_e:
	    fprintf(stderr, "max key: length = %2d, string = %s\n", maxkbuf, maxkstr);
	    fprintf(stderr, "max val: length = %2d, string = %s\n", maxvbuf, maxvstr);
	    break;
    }
    return;
}

int
main(int argc, char * argv[])
{
    char * type = "";

    if (argc >= 2)
	type = argv[1];

    if (strcmp(type, "header") == 0) {
	printf("%s\n", copyright_string);
	printf("/*\n * This file is automatically generated\n * DO NOT EDIT!\n */\n\n");

	printf("/*\n");
	dump_names(gen_comments_e);
	printf(" */\n\n\n");

	printf("/*\n");
	printf(" * Note: The MACOSX_DEPLOYMENT_TARGET environment variable should be used\n");
	printf(" *       when building an application targeted for an earlier version of\n");
	printf(" *       Mac OS X.  Please reference Technical Note TN2064 for more details.\n");
	printf(" */\n\n");

	printf("/*\n");
	printf(" * Note: For Cocoa/Obj-C/Foundation applications accessing these preference\n");
	printf(" *       keys you may want to consider the following :\n");
	printf(" *\n");
	printf(" *       #define " SC_SCHEMA_DECLARATION "(k,q)\textern NSString * k;\n");
	printf(" *       #import <SystemConfiguration/SystemConfiguration.h>\n");
	printf(" */\n\n");

	printf("/*\n");
	printf(" * Note: For CFM applications using these schema keys you may want to\n");
	printf(" *       consider the following :\n");
	printf(" *\n");
	printf(" *       #define " SC_SCHEMA_DECLARATION "(k,q)\n");
	printf(" *       #define " SC_SCHEMA_KV "(k,v,t)\tlookup_SC_key( CFSTR( #k ) )\n");
	printf(" *       #include <SystemConfiguration/SystemConfiguration.h>\n");
	printf(" *\n");
	printf(" *       CFStringRef lookup_SC_key(CFStringRef key)\n");
	printf(" *       {\n");
	printf(" *         // this function should [dynamically, on-demand] load the\n");
	printf(" *         // SystemConfiguration.framework, look up the provided key,\n");
	printf(" *         // and return the associated value.\n");
	printf(" *       }\n");
	printf(" */\n\n");

	printf("/*\n");
	printf(" * Note: Earlier versions of this header file defined a \"SCSTR\" macro\n");
	printf(" *       which helped to facilitate Obj-C development. Use of this macro\n");
	printf(" *       has been deprecated (in Mac OS X 10.4) in favor of the newer\n");
	printf(" *       \"" SC_SCHEMA_DECLARATION "\" and \"" SC_SCHEMA_KV "\" macros\n");
	printf(" */\n\n\n");

	printf("#ifndef\t_SCSCHEMADEFINITIONS_H\n");
	printf("#ifdef\tUSE_SYSTEMCONFIGURATION_PRIVATE_HEADERS\n");
	printf("#include <SystemConfiguration/_SCSchemaDefinitions.h>\n");
	printf("#else\t/* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */\n");
	printf("#define\t_SCSCHEMADEFINITIONS_H\n");
	printf("\n");

	printf("/* -------------------- Macro declarations -------------------- */\n\n");

	printf("#include <Availability.h>\n");
	printf("#include <TargetConditionals.h>\n");
	printf("\n");

	printf("/*\n");
	printf(" * Define a schema key/value/type tuple\n");
	printf(" */\n");
	printf("#ifndef " SC_SCHEMA_KV "\n");
	printf("  #define " SC_SCHEMA_KV "(k,v,t)\tk\n");
	printf("#endif\n\n");

	printf("/*\n");
	printf(" * Provide an \"extern\" for the key/value\n");
	printf(" */\n");
	printf("#ifndef " SC_SCHEMA_DECLARATION "\n");
	printf("  #ifndef SCSTR\n");
	printf("    #include <CoreFoundation/CFString.h>\n");
	printf("    #define " SC_SCHEMA_DECLARATION "(k,q)\textern const CFStringRef k q;\n");
	printf("  #else\n");
	printf("    #import <Foundation/NSString.h>\n");
	printf("    #define " SC_SCHEMA_DECLARATION "(k,q)\textern NSString * k q;\n");
	printf("  #endif\n");
	printf("#endif\n");

	printf("/* -------------------- HeaderDoc comments -------------------- */\n\n\n");
	printf("#if\t0\n");
	printf("/*!\n");
	printf(" *\t@header SCSchemaDefinitions\n");
	printf(" */\n");
	dump_names(gen_headerdoc_e);
	printf("\n");
	printf("#endif\t/* 0 */\n\n\n");

	printf("/* -------------------- Schema declarations -------------------- */\n\n");


	dump_names(gen_hfile_e);
	printf("\n");

	printf("#endif\t/* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */\n");
	printf("#endif\t/* _SCSCHEMADEFINITIONS_H */\n");
    }
    else if (strcmp(type, "private") == 0) {
	printf("%s\n", copyright_string);
	printf("/*\n * This file is automatically generated\n * DO NOT EDIT!\n */\n\n");

	printf("/*\n");
	dump_names(gen_comments_private_e);
	printf(" */\n\n\n");

	printf("#ifndef _SCSCHEMADEFINITIONSPRIVATE_H\n");
	printf("#define _SCSCHEMADEFINITIONSPRIVATE_H\n");
	printf("\n");

	printf("/* -------------------- Macro declarations -------------------- */\n\n");

	printf("#include <SystemConfiguration/SCSchemaDefinitions.h>\n\n");

	printf("/* -------------------- HeaderDoc comments -------------------- */\n\n\n");
	printf("#if\t0\n");
	printf("/*!\n");
	printf(" *\t@header SCSchemaDefinitionsPrivate\n");
	printf(" */\n");
	dump_names(gen_headerdoc_private_e);
	printf("\n");
	printf("#endif\t/* 0 */\n\n\n");

	printf("/* -------------------- Schema declarations -------------------- */\n\n");
	dump_names(gen_hfile_private_e);
	printf("\n");

	printf("#endif\t/* _SCSCHEMADEFINITIONSPRIVATE_H */\n");
    }
    else if (strcmp(type, "cfile") == 0) {
	printf("/*\n");
	printf(" * This file is automatically generated\n");
	printf(" * DO NOT EDIT!\n");
	printf(" */\n");
	printf("\n");
	printf("#include <Availability.h>\n");
	printf("#include <TargetConditionals.h>\n");
	printf("#include <CoreFoundation/CFString.h>\n");
	printf("\n");
	dump_names(gen_cfile_e);
    }
    exit(0);
    return (0);
}

